Error occurred in OpenArg of the Openform method

alicejwz

Registered User.
Local time
Today, 19:12
Joined
Jul 9, 2003
Messages
91
I received "Named argument not found" in the OpenArg:=
I can't see why the error occurred. Could you please help me out?

Thank you much!

Private Sub w_o__history_Click()

On Error GoTo Err_w_o_history_Click

Dim stDocName As String
Dim work_ord_num_lookup As String

stDocName = "shipment_history_list"
work_ord_num_lookup = Me!shipping_sched_list_subform.Form!work_ord_num.Value

''Named argument not found" ERROR OCCURRED in the OpenArg:=

DoCmd.OpenForm FormName:=stDocName, OpenArg:=work_ord_num_lookup

Exit_w_o_history_Click:

Set check_wo_history = Nothing
Exit Sub


Err_w_o_history_Click:

MsgBox Err.Description
Resume Exit_w_o_history_Click

End Sub
 
The OpenArgs argument of the OpenForm method can be in this type of form:
"[fieldname]=" & Forms!formname!formfieldname

You've got part of it here:
work_ord_num_lookup = Me!shipping_sched_list_subform.Form!work_ord_num.Value

What you need is the "[fieldname]=" & part of the argument.
 
Crap! You're right Pat. Good eye. I obviously need more sleep.
 

Users who are viewing this thread

Back
Top Bottom