Runntime Error 2105

Ilovexfiles

Registered User.
Local time
Yesterday, 18:19
Joined
Jun 27, 2017
Messages
37
Hi all
I have form, that contains two subforms.
Subform One = Client Info Table
Subform Two = Screening Info Table

Subform Two has a button with following code to create a new screening for this client:
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec

It opens the screening data entry form where:
="[ClientID]=" & [ClientID]

This allows the new screening to be associate with that same Client.

SOMETIMES it gives an error. I can open the same exact Client, and click the the button and not get this error. If the user closes the main form and reopens, they can do the exact same thing with no error.

Any suggestions on how to fix this?

The error is:
Runtime Error "2105"
You can't go to the specified record
End Debug Help

Thanks!
 
That error means an object has lost value, and doesnt exist.
you didnt show all the code so,Im guessing its the recordset.
so,
dont use DoCmd.GoToRecord
use
docmd.FILTER = ...
docmd.FILTERON = TRUE
 
OK, this is a series of wild-eyed guesses.

Check the lock settings on your forms (on form's properties sheet) to verify that you have optimistic locking set.

Be sure that your parent and child forms are established between parent and child tables for which a proper one/many relationship is expressly established.
 
Thanks all,
I used a code found on another post
f Me.NewRecord then
'do this
else
'do that
end if

thanks!!
 

Users who are viewing this thread

Back
Top Bottom