M
Melindi via AccessMonster.com
I have a form that has a button to bring up a notes subform for that
record. The form and subform is based on the tracking number which is an
autonumber. But when I bring up the notes subform, the trackingno is blank
and I can't add new notes. It gives me a null error, because the tracking
number is null. How can I populate the subform with the trackingNo of the
record on the Main form???
On click of the button I have the following code:
Private Sub ViewNotes_Click()
On Error GoTo Err_ViewNotes_Click
DoCmd.OpenForm "sfrmNotes", WhereCondition:="TrackingNo=" & TrackingNo
Me.AllowEdits = True
Exit_ViewNotes_Click:
Exit Sub
Err_ViewNotes_Click:
MsgBox Err.Description
Resume Exit_ViewNotes_Click
End Sub
record. The form and subform is based on the tracking number which is an
autonumber. But when I bring up the notes subform, the trackingno is blank
and I can't add new notes. It gives me a null error, because the tracking
number is null. How can I populate the subform with the trackingNo of the
record on the Main form???
On click of the button I have the following code:
Private Sub ViewNotes_Click()
On Error GoTo Err_ViewNotes_Click
DoCmd.OpenForm "sfrmNotes", WhereCondition:="TrackingNo=" & TrackingNo
Me.AllowEdits = True
Exit_ViewNotes_Click:
Exit Sub
Err_ViewNotes_Click:
MsgBox Err.Description
Resume Exit_ViewNotes_Click
End Sub