Run-time Error '2493'

P

Playa

I'm trying to save a record and then go to a new record when I hit a button
on my form.
I am getting the following error:

Run-time Error '2493'
This action requires an Object Name argument

Here is the code I have for my save button on the form.

Private Sub cmd_Save_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToRecord acDataForm, frm_Form111, acNext
End Sub

I can't see anything wrong with it. Can someone please help.

Thanks in Advance
 
D

Dan Artuso

Hi,
Your form name should be a string:
DoCmd.GoToRecord acDataForm, "frm_Form111", acNext
 
G

George Nicholson

Try:
DoCmd.GoToRecord acDataForm, "frm_Form111", acNext

The object name needs to be in quotes, just like the example in the Help
file. The error message was trying to direct you to the 2nd argument (i.e,
Object Name) as the problem.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top