Question with Criteria

BenW

Registered User.
Local time
Today, 14:09
Joined
Jul 26, 2006
Messages
33
I currently have a query that is supposed to pull out customers with a particular last name and I would like to know if my criteria is correct because when I type in a last name into a text box named txtLastName on the form FORMCusSearch and hit a button to preview a report in order to see the results, the report comes out blank.

Here is my criteria

"![form]![FormCusSearch]![txtLastName]"

The quotes are part of the criteria, I tried to put it as an = sign but it changed to quotes automatically. Thanks for the help!
 
Ben,

I don't have an exact answer but there are some FANTASTIC Sample Databses in this forum that do exactly what you are trying to do.

Try and have a look at these for some clues.

They also (in my experience) do things alot more professionally than the average user so you might get your answer AND a more by looking through the sample databases priovided.

Good luck !
 
Try this:

Forms![FormCusSearch]![txtLastName]
 
Try this:

Forms![FormCusSearch]![txtLastName]

Unfortunately I got the same result of a blank report. I am aware of the possibility of other errors, but I've worked out a queries that pull out records with the same date and invoice number entered and the only difference I see thus far is the criteria. I suppose I'll take jag's advice and try to look at a sample database to find a solution.

Thanks for the help though.
 
Paul's correction to the criteria syntax will work, try typing a known name into the criteria directly eg "Fred"

One of the many problems can be extraneous spaces , you may have to use a variant of Trim.

brian
 
Same problem with a diff twist.

I'm trying to look for date values.

Long Explanation:

I have an option box that allows you to pick "All","Open","Closed" which resolve to the criterias I want in my query which are Blank, Is Null, and Is Not Null respectively. This is saved in a textbox called "capaStatus_Selected"

In my criteria I have [Forms]![frmReportParameters]![capaStatus_Selected]
but the SQL statement doesn't come out correctly.

Short Explanation:
How do you resolve "Is Null" or "Is Not Null" in the criteria using a textbox on a form.
 
BenW; Why not take user error out of the equation and populate a combo list with a list of all the names available? You can do this with a query by querying your customers table something like
Code:
( SELECT DISTINCT LastName FROM CustomerTable )

Put that as the Table/Query in the RowSource property of the Combo List
 
Don't know what happened to the Link try again.

Worth a read even if you have solved the problem.

Brian
 

Users who are viewing this thread

Back
Top Bottom