Error Code 2105 - Add New Record from Button

J

jkoca

I have a form with a command button to add a new record, and also have the
standard navigation strip. The table I am adding to has required fields. If
I try to add the record from the navigation bar (>*) before I have completed
the required fields, I get a reasonable message which indicates the field
that is missing a value. If on the other hand, I try to add a records from
the button using the following little snippet...

DoCmd.GoToRecord , , acNewRec
Me!txtCommonName.SetFocus

I get an error 2105 telling me I can't go there.

I have a couple of questions...

Is there documentation on the various error codes ?

Why do these react differently. Do I need to perform some other step in the
VBA code ?

Whatever help you could provide would be appreciated.

Jim Koca
 
B

Bryan B.

Bound or unbound form?
Why don't you try turning on the Access wizards and try
making a command button to move to a new record? That is
what I did when I got that error in a bound form in my
database. I haven't encountered that problem yet in my
unbound forms, though.

Bryan
Computer Systems Analyst
 

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

Similar Threads


Top