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

Setting Criteria in an Unbound Text Box with a wildcard character

Status
Not open for further replies.

pac38

Programmer
Oct 1, 2003
7
0
0
US
I am trying to count the number of records in a report using an unbound text box using a field name with a criteria using a wildcard, but it still counts all the records ignoring the criteria. Any ideas what I could be doing wrong????

Looks like this: =count([field] like"7*")
 
That's the problem with "Count" it counts the number of records in the query regardless of what you use as the argument to count. The only difference between "Count(*)" and "Count(tbl.Field)" is that the first one counts nulls and the second doesn't. In your case, it is counting every record. If you want the count of field values matching "7*" then your underlying query needs to specify

WHERE [field] LIKE "7*"
 
Thanks, thats what I thought but wasn't sure.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top