P
Pamela
I have a command button on frmVehicle that is supposed to open frmInspection
and find (if it's been entered) the related record based on the VehicleID
fields in both tables which have a one-to-many relationship. I used the
wizard to create the button but it isn't linking correctly - the VehicleID
field in frmInspection stays at 0. Any help or insight with this would be
greatly appreciated! Here is the code that the wizard created for the button:
Private Sub OpenInsp_Click()
On Error GoTo Err_OpenInsp_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmInspection"
stLinkCriteria = "[VehicleID]=" & Me![VehicleID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenInsp_Click:
Exit Sub
Err_OpenInsp_Click:
MsgBox Err.Description
Resume Exit_OpenInsp_Click
End Sub
Thanks again!
and find (if it's been entered) the related record based on the VehicleID
fields in both tables which have a one-to-many relationship. I used the
wizard to create the button but it isn't linking correctly - the VehicleID
field in frmInspection stays at 0. Any help or insight with this would be
greatly appreciated! Here is the code that the wizard created for the button:
Private Sub OpenInsp_Click()
On Error GoTo Err_OpenInsp_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmInspection"
stLinkCriteria = "[VehicleID]=" & Me![VehicleID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenInsp_Click:
Exit Sub
Err_OpenInsp_Click:
MsgBox Err.Description
Resume Exit_OpenInsp_Click
End Sub
Thanks again!