G
Guest
Private Sub Command20_Click()
On Error GoTo Err_Command20_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Add tech rep"
stLinkCriteria = "[ID work details]=" & Me![ID Work details]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click
End Sub
I have a command button on a form using the code above created from the
button wizard. The button works in opening a form linked by ID work details
but it opens as a new record. What I would like is to automatically have the
ID work details number loaded on the form on opening to link the information
on the tech rep form. I am new to using code so any help is appreciated.
Thanks
On Error GoTo Err_Command20_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Add tech rep"
stLinkCriteria = "[ID work details]=" & Me![ID Work details]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command20_Click:
Exit Sub
Err_Command20_Click:
MsgBox Err.Description
Resume Exit_Command20_Click
End Sub
I have a command button on a form using the code above created from the
button wizard. The button works in opening a form linked by ID work details
but it opens as a new record. What I would like is to automatically have the
ID work details number loaded on the form on opening to link the information
on the tech rep form. I am new to using code so any help is appreciated.
Thanks