J
jim
Hi, how can I pass OpenArgs(a string) that has a comma in it? In the pop-up
form, that I pass the OpenArgs to, I put the two arguments in an array and so
it comes to the first comma and separates my string, which is the first
element of the array, into OpenArgs(0) and OpenArgs(1). What I need to
happen is the string should all go into OpenArgs(0) and the next element, an
integer, go into OpenArgs(1). Here's my code:
Private Sub Option96_Click()
Dim strOpenArgs As String
strOpenArgs = Me.txtCustomerName & "," & Me.txtBuildingNo
On Error Resume Next 'trap error 2501
DoCmd.OpenForm "sfrmClientBuildContacts", , , "[CustomerName] = """ &
Me!CustomerName & """ And [BuildingNo] = " & Me!BuildingNo, , , strOpenArgs
If Err.Number = 2501 Or Err.Number = 0 Then ' ignore the error
Else ' tell the user about the error
MsgBox Err.Number & " " & Err.Description
End If
End Sub
Do I have to put quotes around -Me.txtCustomerName &- when it's assigned to
strOpenArgs? I tried it several ways and can't get it right.
TIA
form, that I pass the OpenArgs to, I put the two arguments in an array and so
it comes to the first comma and separates my string, which is the first
element of the array, into OpenArgs(0) and OpenArgs(1). What I need to
happen is the string should all go into OpenArgs(0) and the next element, an
integer, go into OpenArgs(1). Here's my code:
Private Sub Option96_Click()
Dim strOpenArgs As String
strOpenArgs = Me.txtCustomerName & "," & Me.txtBuildingNo
On Error Resume Next 'trap error 2501
DoCmd.OpenForm "sfrmClientBuildContacts", , , "[CustomerName] = """ &
Me!CustomerName & """ And [BuildingNo] = " & Me!BuildingNo, , , strOpenArgs
If Err.Number = 2501 Or Err.Number = 0 Then ' ignore the error
Else ' tell the user about the error
MsgBox Err.Number & " " & Err.Description
End If
End Sub
Do I have to put quotes around -Me.txtCustomerName &- when it's assigned to
strOpenArgs? I tried it several ways and can't get it right.
TIA