E
Emma
I'm getting a subscript out of range error when trying to pass arguments via
OpenArgs. This is my code in my first form.
Private Sub Job_Type_AfterUpdate()
Dim MyOpenArgs As String
MyOpenArgs = Me!Job_ID & "-" & Me!Account_No
Select Case Me!Job_Type
Case "New Contract"
DoCmd.GoToControl "Frame_Contract_Option"
Case "Rental"
DoCmd.OpenForm "frm_Rental_Detail", acNormal, Qry_Rental_Detail, ,
acFormAdd, acWindowNormal, MyOpenArgs
Case "Evaluation"
DoCmd.OpenForm "frm_Eval_Detail", acNormal, Qry_Eval_Detail, ,
acFormAdd, acWindowNormal, MyOpenArgs
Case Else
DoCmd.GoToControl "Rep_name"
End Select
End Sub
In my second form I have:
Private Sub Form_Load()
FK_Master_Job_ID = Split(MyOpenArgs, "-")(0)
Rental_Acct_No = Split(MyOpenArgs, "-")(1)
End Sub
Anyone know why I am getting this error?
OpenArgs. This is my code in my first form.
Private Sub Job_Type_AfterUpdate()
Dim MyOpenArgs As String
MyOpenArgs = Me!Job_ID & "-" & Me!Account_No
Select Case Me!Job_Type
Case "New Contract"
DoCmd.GoToControl "Frame_Contract_Option"
Case "Rental"
DoCmd.OpenForm "frm_Rental_Detail", acNormal, Qry_Rental_Detail, ,
acFormAdd, acWindowNormal, MyOpenArgs
Case "Evaluation"
DoCmd.OpenForm "frm_Eval_Detail", acNormal, Qry_Eval_Detail, ,
acFormAdd, acWindowNormal, MyOpenArgs
Case Else
DoCmd.GoToControl "Rep_name"
End Select
End Sub
In my second form I have:
Private Sub Form_Load()
FK_Master_Job_ID = Split(MyOpenArgs, "-")(0)
Rental_Acct_No = Split(MyOpenArgs, "-")(1)
End Sub
Anyone know why I am getting this error?