Private Sub cmdAdd_Click()
On Error GoTo Err_cmdAdd_Click
DoCmd.GoToRecord , , acNewRec
Exit_cmdAdd_Click:
Exit Sub
Err_cmdAdd_Click:
MsgBox Error$
Resume Exit_cmdAdd_Click
End Sub
Thank you.
If this also crashes, try turning off the Name AutoCorrect check boxes
(Tools | Options | General), and the compact and repair your database (Tools
| Database Utilities). Explanation:
http://allenbrowne.com/bug-03.html
Private Sub cmdAdd_Click()
On Error GoTo Err_cmdAdd_Click
If Me.Dirty Then 'Save before move.
Me.Dirty = False
End If
If Me.NewRecord Then
Beep
Else
RunCommand acCmdRecordsGotoNew
End If
Exit_cmdAdd_Click:
Exit Sub
Err_cmdAdd_Click:
MsgBox Error$
Resume Exit_cmdAdd_Click
End Sub
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"101ONTLTD" <anon...@discussions.microsoft.com> wrote in message
news:19b1401c44d95$ad1077e0$a301...@phx.gbl...
I just realized that my problem is in the following code
not the one I gave previously:
Private Sub cmdEnterResults_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70
DoCmd.SetWarnings False
DoCmd.OpenQuery "qappNewResponses"
Me![sfrmResponses].Requery
DoCmd.SetWarnings True
End Sub
Please help.
>.
>
The comments about turning off Name AutoCorrect still apply: even moreso now
you are running a query as well.
Try replacing the 4th line with:
Me![sfrmResponses].Form.Requery
so that you are explicitly requerying the form in the subform control rather
than merely the subform control.
If the problem still occurs, and qappNewResponses is an action query, you
could try:
DoCmd.RunSQL "qappNewResponses"
or
dbEngine(0)(0).Execute "qappNewResponses", dbFailOnError
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"101ONTLTD" <anon...@discussions.microsoft.com> wrote in message
news:1a57f01c44e3e$9fe6f9f0$a101...@phx.gbl...