Error 2499

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top