Forcing user to select a value from list

hgus393

Registered User.
Local time
Today, 04:11
Joined
Jan 27, 2009
Messages
83
Hi,
I am at a loss trying to suss out how to do this. What I am trying to do is:
I have a report that shows a report for 5 units. Now I want the users to be able to choose which unit they want the report to display. The report is based on a pretty simple select query. I have been toying with the idea of using a simple form poping up where the user can select which unit they want..But the way to go from the form to the final report is where I fail. Has any of you guys done this before, any hints? :confused:
Cheers
Bob
 
Where you are having problem tell some detail
 
Well what I am having difficulties with is how to actually perform the linkage of the form (where the user can select the unit) to the query that dispalys the report...so basically from scratch I guess...
Bob
 
You will need to reference the unbound text box from the form you wish to run the query from, to the QUERY CRITERIA for the selected search.

Cheers
 
Aha, is it that easy? :rolleyes:
Will give that a whirl!
Cheers
Bob
 
lyconal is right

for any report/form you basically need to base it on a query, which is designed to select only the data in which you are interested.

you use the criteria row(s) of the query to define your selections - this can either be

explicitly hard type

<= #31/12/08# ie up to 31st dec 2008


obtain from user at run time, as a query parameter

<= [enter required date]


but more likely (more flexibly!), referring to a field on a form

<= forms!someform!selectiondate (same thing)

the syntax for this latter example has to be right, and this example may be slightly off, but you should get the picture


or in a similar fashion by testing a variable, which HAs to be with a function

<= function_to_read_a_variable() (again same thing)

-----------
the criteria etc, for a query can be very much more complex - which is why 99% of the time the answer to anything in access IS a query.
 
Wow, that is a very good explanation! I have however a little problem with this. It is no problem setting up a form that is linked to the query and thereafter the report. But how can I make the query choose all the records if nothing is choosen (ie unit is blank)?:confused:
Bob
 
Last edited:
Never mind found a solution:

[Forms]![myForm]![myControl] OR [Forms]![myForm]![myControl] Is Null

Bob:D
 

Users who are viewing this thread

Back
Top Bottom