I have the following code.....and its not working as expected.
If user types in "n" for some reason the variable "ppm_input_error" is not getting set to true. Any ideas?
Sub get_ppm_answer_from_user(ppm_answer As String, ppm_input_error As Boolean, msg_string As String)
ppm_answer = Application.InputBox(msg_string)
MsgBox ("ppm answer is *" & ppm_answer & "*")
If ppm_answer = "" Then
ppm_input_error = True
ElseIf StrtDate = "False" Then
ppm_input_error = True
ElseIf ppm_answer = "Y" Or ppm_answer = "y" Or ppm_answer = "N" Or ppm_answer = "n" Then
ppm_input_error = False
ElseIf ppm_answer = "N" Or ppm_answer = "n" Then
MsgBox ("in n")
ppm_input_error = True 'ppm data not up to date
MsgBox (ppm_input_error)
Else: ppm_input_error = True
MsgBox ("You have input incorrect text for this question. It is assumed that the PPM data is NOT up to date.")
End If
MsgBox (ppm_input_error)
End Sub
Bookmarks