Error 2499

G

Guest

Hi all,
I get an error: "You can't use the GoToRecord action or method on an object
in Design view." the error is generating on the GoToRecord line. Its a table
based form and it happens when i try to open an employee twice. The table PK
is autonumber (ID).
Any suggestions?
Here is the code of my procedure:
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frm_verify_details"
DoCmd.GoToRecord , , acNewRec
Form.Refresh
Form.Visible = False
'DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria


Exit_Command11_Click:
Exit Sub

Err_Command11_Click:
MsgBox " 111"
Resume Exit_Command11_Click
End Sub
 
W

Wayne Morgan

I don't fully follow what you're saying. You say this happens when you try
to "open an employee twice", but I can't tell here where you're trying to
open the employee. If clicking the button is what does it, it appears that
you're hiding the form in the button's click event, so how is the button
visible to click it again in order to "open the employee twice". Also, I
don't see where you're assigning a value to strLinkCriteria to control what
record frm_verify_details shows when it opens.
 

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