T
TAMAJAMA
Guest
I have run into a problem with sending code to a new form. This code shown below was previously working, however it was sending a text "query" to the form named "COC Form", now I need it to send the AutoNumber (which is also the Primary Key). Is there any reason why the code would not work with AutoNumbers set as the Primary key?
Private Sub Command102_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "COC Form"
stLinkCriteria = "[IDNUMBER]=" & "'" & Me![IDNUMBER] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command102_Click:
Exit Sub
Err_Command102_Click:
MsgBox Err.Description
Resume Exit_Command102_Click
End Sub
THANKS IN ADVANCE FOR ANY HELP!!
TamaJama
Private Sub Command102_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "COC Form"
stLinkCriteria = "[IDNUMBER]=" & "'" & Me![IDNUMBER] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command102_Click:
Exit Sub
Err_Command102_Click:
MsgBox Err.Description
Resume Exit_Command102_Click
End Sub
THANKS IN ADVANCE FOR ANY HELP!!
TamaJama