Access 2007 - Using VBA (I think)

Discussion in 'Software' started by toehead410, Apr 21, 2008.

  1. toehead410

    toehead410 Corporal

    tableGroup (with primary key GroupID5digit) contains general data about families, couples and individuals. tableMember (with 2 digit ID extension MemberID2digit) contains data about the individual members of the group. I have formVisit that asks user to enter both the GroupID5digit and MemberID2digit both found on a member's ID card) and then press buttonSearch. The result I want is to present the user with the name of the selected member (for verification) then allow them to press buttonSave to log the current date and GroupID5digit and MemberID2digit to tableVisit OR to re-enter the member numbers and press buttonSearch again. I have all the tables and forms necessary as well as a query that will perform the search. How do I set up a [macro, VBA code, or other] to complete these steps?

    The biggest problem I am having in this is how to take the resulting contents of the firstname and lastname fields from the query and have them displayed in a textbox for the user to verify before saving the record.

    I hate being a novice!!

    Thanks Geeks,
    Jason
     
  2. PC-XT

    PC-XT Master Sergeant

    I use Excel rather than Access, so I'm not sure about your first paragraph, but I can answer the second:
    Code:
    Sub YesNoMessageBox()
    Dim Answer As String
    Dim MyNote As String
        'Place the fields to check before vbCrLf in the following question
        MyNote = vbCrLf&"Is this correct?"
        'Display MessageBox
        Answer = MsgBox(MyNote, vbQuestion + vbYesNo, "???")
        If Answer = vbNo Then
            'Code for No button Press
            MsgBox "You pressed NO!"
        Else
            'Code for Yes button Press
            MsgBox "You pressed Yes!"
        End If
    End Sub
    BTW, did u know?
    Code:
    J uly
    A ugust
    S eptember
    O ctober
    N ovember
    
     
  3. toehead410

    toehead410 Corporal

    [tip of the hat] Thank you sir!!!
     
  4. PC-XT

    PC-XT Master Sergeant

    You're welcome. I originally got most of that code from automateexcel.com. I hope it helps.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds