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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching Criteria 1

Status
Not open for further replies.

tourguy

Technical User
Nov 6, 2003
27
US
I have a report name rptName1, and a table called "Training", with fields Name, LastName, and Date. What I want to do is on my Report - before I open my rptName1, I want a pop up message asking me for the name to look for. Then after I type in a name(for example, I searched for Tom), then the report will open up giving me his last name, date, and etc on the report.
 
Hi,
It is best to create a query, and base the report on the query rather than the table. Inside the query, you can enter something like this into the "criteria" line for the field you wish to select on:
[Enter Last Name]
This will give you the popup box for entering criteria.

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
what I mean is a query, not a table sorry for my mistake
 
You made it so easy... Thanks alot randysmid!!
 
I have one more thing to ask, I have a 2 other fields that
uses checkboxes... 1 called "received" and the other is "shipped". If from the report "recieved" is checked, then I want it to be visible on the report. But if it is not checked, then I want visible to be false. How would I do this on the same report so it saves spaces.
 
Hi,
It sounds like you are new to Access programming. If you like, send me an email and I will send you a free sample database that I created for newbies. It has a homemade security login screen, a homemade menu system, plus samples of how to use a form and query to send criteria to a report, plus how to use filter to send criteria to a report directly from a form.
It's called CoreDatabase.MDB, and is 2MB in zipped format. Anyone else is welcome to a copy of this database. Just send me an email. As I said, there is no charge for this and no copyrights on the code.

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Hi,
There is a simple problem with "hiding" columns on a report. First, what if one record has "received" = True, but the next record is False? On the other hand, if you simply want to display a blank when "received" is True, that is simple. You will want to use the IIF (ImmediateIf) statement in the detail section of the report (OnFormat event). Just let me know if you need some sample code for this. (However, I will be in a meeting for several hours)

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
It'll be great if you can give me some examples of that. I really really appreciate it. Thanks!!
 
Hi,
Here is what you might put into Control Source for a text box in your detail section of the report:
=IIf([Product]!ProductQty=0," ",[Product]!ProductQty)

Here is how it works:
First, this is an Immediate If statement. Within the parantheses, you will see a [Product]!ProductQty=0. This is testing for a condition (Product is the table name, and ProductQty is the field).
Next, if the statement is true, then Access is instructed to use the value or string you entered. In this case, it is a single blank (" ").
Finally, if the statement is not true, use the value or string specified in the last part. In this case, just use the value as it is in the table.

HTH, [pc2]
Randy Smith, MCP
rsmith@cta.org
California Teachers Association
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top