I am trying to refer to a field in another table but I don't know the correct syntax. Can someone please help me out? I am new to this so I really dont know what to do.
I have two tables :
MemberTbl
MemberNum(PK)
SignInTbl
TimeID (PK)
MemberNum
TimeIn
NumGuest
MemFName
MemLName
dtmStamp
NumGuest
I have a sign in form which has a MemberNum and NumGuest control. I want to add a command button that allows the user to click it and then receive a msg that tells them they have successfully signed in and gives the MemberName and then update the tables. Can someone tell me how to update the tables with the data entered. It's not updating the time in the Member table. This is what I have so far:
Private Sub SignIn_Cmd_Click()
If Me.Form.Dirty Then
If MsgBox("Do You Want to Sign In?", vbYesNo + vbQuestion, "Sign In?") = vbYes Then
MsgBox DLookup("[MemFName]", "MemberTbl", Me.MemberNum) & " has been Signed In", vbOKOnly + vbInformation, "SUCCESSFULLY SIGNED IN"
DoCmd.RunCommand Command:=acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec 'Add New Record
Else
Me.Form.Undo
End If
End If
End Sub
I have two tables :
MemberTbl
MemberNum(PK)
SignInTbl
TimeID (PK)
MemberNum
TimeIn
NumGuest
MemFName
MemLName
dtmStamp
NumGuest
I have a sign in form which has a MemberNum and NumGuest control. I want to add a command button that allows the user to click it and then receive a msg that tells them they have successfully signed in and gives the MemberName and then update the tables. Can someone tell me how to update the tables with the data entered. It's not updating the time in the Member table. This is what I have so far:
Private Sub SignIn_Cmd_Click()
If Me.Form.Dirty Then
If MsgBox("Do You Want to Sign In?", vbYesNo + vbQuestion, "Sign In?") = vbYes Then
MsgBox DLookup("[MemFName]", "MemberTbl", Me.MemberNum) & " has been Signed In", vbOKOnly + vbInformation, "SUCCESSFULLY SIGNED IN"
DoCmd.RunCommand Command:=acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec 'Add New Record
Else
Me.Form.Undo
End If
End If
End Sub