Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query by form

Status
Not open for further replies.

ejiro

Programmer
Aug 1, 2003
17
US
I have a query linked to a form with a command button. In the query I have some criteria fields controlled by the text box field.

I can't seem to search for all records from the "Form". This would be an equivalent to the (Like "*") in the criteria field of the query design view. Does anyone know how to get over this problem.

Thanks...
 
Play with the Nz function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

I tried the Nz function but it does not work. Any other ideas...
 
I tried the Nz function but it does not work
Can you please post your try and explain us what didn't work ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

In the query criteria I tried Nz([Forms]![FormName]![CellName])

I am not sure why it did not run...
 
And this ?
Like Nz([Forms]![FormName]![CellName], '*')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

Thanks a bunch, it worked...
 
Another way:
=[Forms]![FormName]![CellName] Or [Forms]![FormName]![CellName] Is Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PHV,

I am trying to the same thing with a date field in the form. When I enter a search variable like >#01/05/2005# I get data back. Any suggestions...
 
You can set your criteria to

>=Nz(Forms!frmName!txtStartDate, [YourDateFieldNameHere])

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks for the tips dhookom and PHV. Can you recommend a book that shows a lot of the tips that you use as solutions? And does anyone know where I can find a good database management resource (book, cd, website ...) that focuses on managing a DB project?
Thanks a bunch for the insights ...
 
I think all of my answers and probably PH's come from a basic understanding of Access, VB, expressions,... These can be pulled from almost any decent Access book.

What the books and other resources don't provide is the experience. Combining this piece of knowledge with another piece of knowledge comes from experience and a little creative thinking. Much of this is passed on in these types of forums and news groups.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top