Run time error 2105 - can't go to specified record

B

Bob Waggoner

Access 2003; XP
When I go into design view on a form and then return to form view, I get a
runtime error 2105 that says I cannot go to the specified record. Why can't I
go to a new record when I load or open a form from design view?

My code is:

Private Sub Form_Load()
On Error GoTo Err_form_load

DoCmd.Maximize
DoCmd.GoToRecord , , acNewRec
Exit_Form_Load:
Exit Sub
Err_form_load:
DoCmd.GoToRecord , , acLast
Resume Exit_Form_Load

The err_Form_load: is desgined to accept the error and move to the last
record. But, despite that, it still gives me the access message and then
reverts to the first record when I say END. (I don't want the user clicking
debug!)

Access 2003 - recently converted from 97.

Any help would be appreciated.
 
B

Bob Waggoner

Nevermind. I discovered my error. The underlying query was not set up for new
records. Two tables were joined with a one-to-one relationship.
 
T

tina

i just tested a two-table query where the tables were joined in a one-to-one
relationship in the Relationships window, with referential integrity
enforced. i was able to open the Select query and add new records,
regardless of whether the query join was a LEFT JOIN, INNER JOIN, or RIGHT
JOIN between the parent table and the child table (even a one-to-one
relationship has a parent and child).

i'm thinking there was something else preventing your query from being
updateable.

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