This seems to happen to me a lot.
I use a command button to check various parameters, then open another form based on these parameters. However, I cannot seem to get the current form I am on to add a new record.
Here is the code I am using that is part of a command button:
If Me.Team_Fumbled = 1 And Me.Team_Recovered = 2 And Me.Returned_To <> 0 Then
strMsg = "Fumble on the Kickoff Return. Recovered by " & Me.Opponent
MsgBox (strMsg)
DoCmd.OpenForm "Defense Game Input Screen"
Forms![Defense Game Input Screen]![Quarter] = Me.Quarter
Forms![Defense Game Input Screen]![Yardline] = Me.Returned_To
Forms![Defense Game Input Screen]![Side of Field] = Me.Returned_To_Side
'Here is the code that should add a new record:
DoCmd.GoToRecord acDataForm, "Fumble on Kickoff Return", acNext
DoCmd.Close acForm, "Fumble on Kickoff Return"
Exit Sub
End If
I have tried:
DoCmd.GoToRecord acDataForm, "Fumble on Kickoff Return", acNewRec
and
DoCmd.RunCommand acCmdRecordsGoToNew
None of these will add a new record. This form is a popup and is modal. Any suggestions?
I use a command button to check various parameters, then open another form based on these parameters. However, I cannot seem to get the current form I am on to add a new record.
Here is the code I am using that is part of a command button:
If Me.Team_Fumbled = 1 And Me.Team_Recovered = 2 And Me.Returned_To <> 0 Then
strMsg = "Fumble on the Kickoff Return. Recovered by " & Me.Opponent
MsgBox (strMsg)
DoCmd.OpenForm "Defense Game Input Screen"
Forms![Defense Game Input Screen]![Quarter] = Me.Quarter
Forms![Defense Game Input Screen]![Yardline] = Me.Returned_To
Forms![Defense Game Input Screen]![Side of Field] = Me.Returned_To_Side
'Here is the code that should add a new record:
DoCmd.GoToRecord acDataForm, "Fumble on Kickoff Return", acNext
DoCmd.Close acForm, "Fumble on Kickoff Return"
Exit Sub
End If
I have tried:
DoCmd.GoToRecord acDataForm, "Fumble on Kickoff Return", acNewRec
and
DoCmd.RunCommand acCmdRecordsGoToNew
None of these will add a new record. This form is a popup and is modal. Any suggestions?