allowing the user to enter a value into criteria field

eyeseetee

New member
Local time
Today, 15:32
Joined
Nov 29, 2007
Messages
6
Hi

I have a report which is genetrated from a query created in query design
In query design there is a column called criteria

Is there a way I can do the following

A user chooses a value from a combo box(i.e. a column name)
then enters some criteria to narrow down the query (i.e. by a certain surname)

The user's criteria is inserted into the criteria field in query design and next to the correct row(i.e. column surname)

Is i possible to do this through VB or will I have to write out the query in vb and do it through a form

thanks for any help in advance
 
I know you can add parameters and make them work as a criteria. Once you open the report/query, a popup appears and ask you for a criteria value (tho not a combobox).

I'm not really sure if you can make a field of an entry become a criteria value, maybe what you are looking for should be done via form by using parameters.

This thread may help you :D

http://www.access-programmers.co.uk/forums/showthread.php?t=142592
 
Last edited:
Criteria in a query

As capsula4 said, I'd create a form with either dropdowns if that's what you want or just txt fields, then reference that form and txts in the query criteria like below -> Forms![frmyourformname]![txtyourtxtfield] then have a cmd that runs the query (or report if you want) from the frm. Uses bugger all coding and you can make the form match your DB instead of ugly 'parameter' boxes popping up when you run the qry. Also, you can re-use it for multiple qrys (I have one that controls 20+ qrys/rpts).
 
Hi

thanks for replying
i tried putting = N'Forms!frmopenreport!tbitemid' into the criteria field but my report doesnt bring anything back now
what would be the reason for this?

cheers
 
Hi i should note it is an adp database, does the syntax differ for this?
 
Adp

Sorry mate, I don't have much experience with .adp stuff. You may need to ask around at a sql site or similar, sorry.
 

Users who are viewing this thread

Back
Top Bottom