Calling criteria of a report based on form text box.

r3df1sh

Registered User.
Local time
Yesterday, 19:37
Joined
Sep 8, 2004
Messages
16
Please forgive my ignorance on this, but I am new to the Access world.
I have searched the forums and am lacking on ideas.

I am working on calling a report based on a textbox on my form. The textbox is populated by a combobox.
The text box will consist of choices like all, location1, location2, etc...
When the value is "All" it shows all the records in the report.
When any other value it shows that specific location only in the report.

I am wanting to execute this via the commandbutton click.

Please help me with the coding necessary.

Thanks in Advance to any response.
 
ok I figured out how to do most of my problem via a query, however I am stumped on how to include the "ALL" entry.

If the field is set to All it then populates all records in the report.
 
Quite Simple

Leave the Textbox Blank..

Just out of Curiosity why are u using a textbox ... you can use the same combo box as your source for report

in the report, the text box which refers to you textbox in form use the following
[Forms]![YourFormName]![ComboBiox]

this will print or preview only that record whihc is in combobox
 
Thank you for your response.

I will try to better explain my situation.
In my table the records are stored with a Location field (ex. Earth, Venus, Mercury).
I currently use the combobox on the form to dictate what records are displayed on the listbox. The combobox has All, Location1, Location2, etc...
When the value all is selected it shows all the records via vb. (When a specific location is selected only those matching records are shown).

I have the value piped to a textbox for the time being and will move it to the combobox once I have it up and going for the reporting.

My problem is the report handling when the All value is selected. I need it to show all the records in the report. That part elludes me.
 

Users who are viewing this thread

Back
Top Bottom