Results 1 to 3 of 3
  1. #1
    DCV0204 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    85

    Message Box

    Ok, I have the following 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.
    'DoCmd.OpenForm "AddNewFile", , , "Provider.Medicaid_ID = '" & SrchMed_ID & "'"
    Else

    ' 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 "Copy Of UpdateCurrentFile", , , "Provider.Medicaid_ID = '" & SrchPurgeMed_ID & "'"
    Else 'User chose No.
    MyString = "No" 'Perform some action.
    'Msg = "Give file to Amanda" & vbNewLine & vbNewLine & "for further review."

    End If

    End If


    End Sub


    I am wanting 2 reponses, MyString = "Yes" response is working. It opens the form requested.
    My issue is I can not get an additional message box to pop-up when "No" is selected. I know
    that this is propbably a simple fix but for some reason I can not figure this out. I would like
    the Msg in red above to be a message box with an "Ok" button.

    Thanks,
    Lisa

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    One possible approach:
    Replace this:
    Code:
    'Msg = "Give file to Amanda" & vbNewLine & vbNewLine & "for further review."
    With:
    Code:
    MsgBox "Give file to Amanda" & vbNewLine & vbNewLine & "for further review."
    Hope that helps.

  3. #3
    DCV0204 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    85
    Thanks that worked beautifully.....

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 09-26-2012, 12:20 PM
  2. Message Box
    By cbrsix in forum Programming
    Replies: 3
    Last Post: 06-08-2012, 01:44 PM
  3. Need Help with message box.
    By Grahamvdh in forum Programming
    Replies: 1
    Last Post: 05-10-2012, 01:29 PM
  4. Message Box
    By Alex Motilal in forum Forms
    Replies: 1
    Last Post: 03-27-2012, 08:31 AM
  5. Message box
    By tomneedshelp in forum Forms
    Replies: 1
    Last Post: 03-22-2012, 10:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums