T
TwinDad
Hello All,
I have a Form that I need to open based on either On Criteria or another. I
created a "View Detail" Button Using the wizard, but it only opens it by
Customer Number.
My table holds both existing customers (They have Customer_Numbers) and
patrons that call in (They do not have Customer_Number). I can open the ones
with customer numbers but when i try to open the one without a
Customer_Number I get a Blank Screen. In the Properties it shows;
Filter: [Customer_Number]='' (These are 2 Single Quotes)
I Placed have this "If Statement" in the Event procedure.
I would just use the If Statement if it wasn't for the fact that there are
Customers with the Same name in the Cus
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria2 As String
stDocName = "frmAllCallsCustomerAndNon_Detail"
If [Customer_Number] = Null Then
stLinkCriteria = "[CompName]=" & "'" & Me![CompName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
stLinkCriteria2 = "[Customer_Number]=" & "'" & Me![Customer_Number]
& "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria2
End If
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
I have a Form that I need to open based on either On Criteria or another. I
created a "View Detail" Button Using the wizard, but it only opens it by
Customer Number.
My table holds both existing customers (They have Customer_Numbers) and
patrons that call in (They do not have Customer_Number). I can open the ones
with customer numbers but when i try to open the one without a
Customer_Number I get a Blank Screen. In the Properties it shows;
Filter: [Customer_Number]='' (These are 2 Single Quotes)
I Placed have this "If Statement" in the Event procedure.
I would just use the If Statement if it wasn't for the fact that there are
Customers with the Same name in the Cus
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim stLinkCriteria2 As String
stDocName = "frmAllCallsCustomerAndNon_Detail"
If [Customer_Number] = Null Then
stLinkCriteria = "[CompName]=" & "'" & Me![CompName] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
stLinkCriteria2 = "[Customer_Number]=" & "'" & Me![Customer_Number]
& "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria2
End If
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub