How to show all records

AccessKurzo

Dazed and Confused
Local time
Today, 03:23
Joined
Jan 5, 2001
Messages
55
I have a text box that holds a Customer ID. If the user selects a customer from the combo, it writes the ID to this text box. I want a query to use this as the parameter, if it is blank, I want ALL records returned - How can this be done?

I know the query is easy if the user selects something, but what do I write in the text box if I want all records to show?

Thanks
 
Last edited:
In the line below where you wrote the reference to the textbox write:

(Forms!FormName!TextBox) Is Null
 
thanks for the reply

I tried this code:

If Me.FrameCust.Value = 1 Then
'all records
stDocName = "Accounts Receivable"
DoCmd.openReport stDocName, acPreview
Else
'by customer
stWhere = "[CustID] = " & Me.cboCustomer
stDocName = "Accounts Receivable"
DoCmd.openReport stDocName, acPreview, , stWhere
End If


and it works great - I never had a chance to try yours :)
 

Users who are viewing this thread

Back
Top Bottom