J
JohnE
Hello. I am having a day in which the mind just isn't working. I need to
put the following code into a function (module) but drawing a blank on how to
do it. Just need to pass the one parameter (slip_number) into the function.
Public Sub FindPackingSlip(ByVal slip_number As Long)
On Error GoTo Err_FindPackingSlip
'Need to remove any filters from form
Me.FilterOn = False
'Requery form in case new records were added immediately preceding this call
Me.Requery
'Find the record
Me.RecordsetClone.FindFirst "PackingSlipID = " & slip_number
If Me.RecordsetClone.NoMatch Then
Beep
MsgBox "Could not find Packing Slip # " & slip_number & ".",
vbInformation, "Packing Slip Not Found"
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
Exit Sub
Err_FindPackingSlip:
Beep
MsgBox err.Description, vbExclamation, "Find Packing Slip Error"
Exit Sub
End Sub
Thanks for any help on this.
John
put the following code into a function (module) but drawing a blank on how to
do it. Just need to pass the one parameter (slip_number) into the function.
Public Sub FindPackingSlip(ByVal slip_number As Long)
On Error GoTo Err_FindPackingSlip
'Need to remove any filters from form
Me.FilterOn = False
'Requery form in case new records were added immediately preceding this call
Me.Requery
'Find the record
Me.RecordsetClone.FindFirst "PackingSlipID = " & slip_number
If Me.RecordsetClone.NoMatch Then
Beep
MsgBox "Could not find Packing Slip # " & slip_number & ".",
vbInformation, "Packing Slip Not Found"
Else
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
Exit Sub
Err_FindPackingSlip:
Beep
MsgBox err.Description, vbExclamation, "Find Packing Slip Error"
Exit Sub
End Sub
Thanks for any help on this.
John