Hi, I am trying to create vb to ask me multiple questions and depending on the answer I would like to either ask another question or go to a control on my form.
I would like to change the MsgBox in red below to be questions if the answer is yes I would like for one thing to happen and if no for something different to happen. They are currently just a msgbox with ok button. So I need them to be vbYesNo but I can not figure out how to get this to work. I have tried many different things with no luck.
Here is my code:
Private Sub purgebtnsrch_Click()
Dim MedID As String
' Get Value from Medicaid_ID textbox on the Form:
Me.purgebtnsrch.SetFocus
Me.SrchPurgeMed_ID.SetFocus
MedID = Me.SrchPurgeMed_ID.Text
Dim Msg, Style, Title, Response, MyString
Msg = (Chr(10)) & " Was this Billing Number located in interChange? "
Style = vbYesNo + vbCritical + vbDefaultButton2
Title = "Critical"
If IsNull(DLookup("Last_Name", "Provider", "Provider.Medicaid_ID = '" & SrchPurgeMed_ID & "'")) Then
' NAME is Null because the Medicaid_ID doesn't exist.
' NAME is not Null because the Medicaid_ID does exist.
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then 'User chose Yes.
MyString = "Yes"
DoCmd.OpenForm "PurgeFileReview", , , "Provider.Medicaid_ID = '" & SrchPurgeMed_ID & "'"
MsgBox "Read Carefully!!!" & (Chr(13)) & (Chr(13)) & "If the provider is Termed in iC, input the Term (End) date into the 'Termed in iC' field." & (Chr(10)) & "(Termed Defined: when all Prog Elig segments have an End Date or Prog Elig is Active and Billing Number is Termed.)" & (Chr(13)) & (Chr(13)) & "Input the 'Research Completed' date." & (Chr(13)) & (Chr(13)) & "Give to Amanda for further review."
MsgBox "If provider is ACTIVE!!!" & (Chr(13)) & (Chr(13)) & "Accuracy check/add all data for fields in Green." & (Chr(13)) & (Chr(13)) & "Add 'Doc_Date' in 'File Purge Log' subform for each dated document." & (Chr(13)) & (Chr(13)) & "(Do Not repeat same date.)"
Else 'User chose No.
MyString = "No" 'Perform some action.
MsgBox (Chr(10)) & " Please give file to Amanda for further review." & (Chr(13)) & (Chr(13)) & " Ready to process next file."
End If
End If
End Sub