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

How to un/show 1 col in a report which depend on usr input in prompt?

Status
Not open for further replies.

TracyYu

Technical User
Feb 9, 2004
17
US
I'm having difficulty on producing this report, hope someone here can enlighten me. Thanks in advance. :)


When user wants a report, I prompt the user for their choice: A, B, C, or D.

If the user choose A, B, or C, the report has the same column titles (e.g. col_M, col_N, col_O, etc.).

If the user's choice is D, then 1 column in the report is different (e.g. col_M, col_E, col_O, etc.)

How can I do that? do I need VBA? if so, how?

Tracy
 
Why don't you just have two reports? Copy the one you have and then point it to an amended query as the recordsource. Choose one or the other depending on which button the user presses.

 
Mike, thanks for your respond. I'm very new with MS Access, never done a amended query before. Can you give more detail on that. also, can you recommand any good books on MS Access?

Tracy
 
Select the report and click design. Now pick a space in the window outside everything else (ie not header etc etc) probably near the bottom. Keep trying until you find where, if you right click and select properties, you see 'Report'. Now select Data and change the recordsource to a query which you have amended to have the alternative field in. Save the report under a new name. Your query should change the name of the new field to be the same as the old field. That means you don't need to change anything else on the report.

 
Mike, thank you for your detail explanation. I tried it your way. I have 2 reports, 1 take care of category 1 ~ 3, and the other report takes care of category 4. it's not exactly I wanted, but I'll leave it this way for now.

I'm wondering if it is possible to do the following thing in Access.

Produce a report within a certain date range (prompt usr) and desired category (1 cat. or all cat.). When a user wants the report for all categories within a date range, the report will print out category 1 first, followed by category 2, then category 3, then 4.

Can one button (All Category) take care of the above process with the 4th category have 1 alternative column?

Tracy

p.s.
there is a squre on the top left corner of the report design view. double click on that, the property of the report will come up.
 
A macro can have any number of actions. So - yes.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top