Thanks again, in advance, for your help. I'll have another couple of questions on this after this little issue gets resolved.
I have a button on a form that opens a popup form to get a list of dates. There are four values to be passed to the popup. Here is the code for button click event:
And here is the code for the Load Event on the popup form.
In opening the popup I get the attached error message. The code doesn't crash, so I don't know where it's hanging up.
Everything looks good. I verified it with a msgbox to see the full value of OpenArgs in the button code. And debug.print strOpenArgs
also showed the four values as being correct. The popup form fields correctly fill with the data.
Hope that was enough info for your advice.
MIB1019
I have a button on a form that opens a popup form to get a list of dates. There are four values to be passed to the popup. Here is the code for button click event:
Code:
Private Sub cmdOpenDateSelector_Click()
On Error GoTo cmdOpenDateSelector_Click_Err
Dim StartDate, EndDate As Date
Dim IODetailID As Long
Dim Program As String
StartDate = Me.txtStartDate
EndDate = Me.txtEndDate
IODetailID = Me.txtDetailID
Program = Me.txtProgram
If Not IsNull(Me.txtStartDate) And Not IsNull(Me.txtEndDate) Then
Dim strOpenArgs As String
strOpenArgs = IODetailID & ";" & StartDate & ";" & EndDate & ";" & Program
DoCmd.OpenForm "Copy of Date Select Dialog", , , , , acDialog, strOpenArgs
Else
MsgBox "I need a date range."
End If
cmdOpenDateSelector_Click_Exit:
Exit Sub
cmdOpenDateSelector_Click_Err:
MsgBox Error$
Resume cmdOpenDateSelector_Click_Exit
End Sub
And here is the code for the Load Event on the popup form.
Code:
Private Sub Form_Load()
'populate the fields on the popup form
Dim strOpenArgs As Variant
strOpenArgs = Split(Me.OpenArgs, ";")
Me!txtDetailID = strOpenArgs(0)
Me!txtStart = strOpenArgs(1)
Me!txtEnd = strOpenArgs(2)
Me!txtIODetailProgram = strOpenArgs(3)
End Sub
In opening the popup I get the attached error message. The code doesn't crash, so I don't know where it's hanging up.
Everything looks good. I verified it with a msgbox to see the full value of OpenArgs in the button code. And debug.print strOpenArgs

Hope that was enough info for your advice.
MIB1019