In my football statistics database, I would like a message box to popup that indicates who scored. For example, if Detroit scores a touchdown, a message box would appear saying Touchdown Detroit. I know that I can simply code
MsgBox("Touchdown Detroit", vbOKCancel) = vbOK
but the teams that are playing are selected on another screen (the switchboard).
I have tried this:
Dim strOpponent As String
strOpponent = Forms![Switchboard]![Opponent]
MsgBox("Touchdown " & strOpponent & "!", vbOKCancel) = vbOK
but the message box simply says Touchdown.
I am think the mistake is in the strOpponent line, but I cannot figure out what it is or what to do.
Thanks for any help.
MsgBox("Touchdown Detroit", vbOKCancel) = vbOK
but the teams that are playing are selected on another screen (the switchboard).
I have tried this:
Dim strOpponent As String
strOpponent = Forms![Switchboard]![Opponent]
MsgBox("Touchdown " & strOpponent & "!", vbOKCancel) = vbOK
but the message box simply says Touchdown.
I am think the mistake is in the strOpponent line, but I cannot figure out what it is or what to do.
Thanks for any help.