title based on combobox

jarheadjim

Registered User.
Local time
Today, 23:24
Joined
Mar 6, 2002
Messages
83
hopefully this is an easy one :) I want to force the user to choose an item from a combo box the FIRST time they open the database. Then I want the db to use their choice in the title of the report already built. Do I need to make a seperate report for each choice? thanks in advance
 
If the report is the SAME and All you ned is for it to report a different title based on the combo box slection, just create a Text Box in theForm Header and in that box, put in

=[forms]![yourformname]![comboboxname]

Edit: Can you beleive how bad my tying was on that.
 
Last edited:
i don't get it?

The report will be identicle in layout for everyone with the exception of the Title. I want to make them choose the "shop name" from a form 1 time only, and then have the db put that shop name in the header of the report from that point on. I don't want to make them do it over and over again.
 
I am not sure I understand either. I assume you have an underlying report you want to run and that the report is run off a Query.

I assume then that the form is what you want the user to use to generate the Report and it has a combobox that the user selects that ONLY changes the Title to the report , i.e., nothing else in the report depends upon (or changes) based on the combo box selection.

If that is right, I think all you need is a Button on the form that "Opens" the report and in the Report itself, add the above text box in the Report Title. The user then selects the combobox item and then the button to Generate the report.

Let me know if I am missing what you want to do.
 
Last edited:
i am going to distribute this db to my whole squadron (i'm in the Marine Corps), I will not have control of it, or access to their copies once I send it out. Basiclly I want to provide them with an easy (Marine proof :P) way of naming their own report. I think a combobox is what I want, and your suggestion will work fine. However, I would rather have them choose from the list one time (ie-the first time they open the db) and never have to mess with it again. Does that make more sense? I'm not dead set on a combobox, it just appeared to me to be the way to go.
 
Sounds like you need to store the Name of the Report they chose in a Table (ReportName) so that after they pick a name one time, it is always available to the reports. You can cause the Querys used for the reports to pick up that stored name and put it in the Header. You can create a Form to "Enter Report Name" with instructions to have them open that form first and create a name they want to use as a header for ALL reports. The form would be for entering data into the ReportName Table. They could go back and "Edit" that name later if they changed their minds. I think, however, the table should have only ONE entry -- the ReportName and does not need a primary Key. The Table will have only the ONE entry in it.

There may be better ways, but since you only want them to chose once, I think they will have to Store the name they chose in a table. If you only want them to be able to choose one of a Set of options for names (i.e., limit the names they can use) you may need a combobox so they select from a list you provide and THAT name is entered into the ReportName table.
 
Last edited:
You could have Access open up the form with the report title chooser combo-box when it opens up. Use the combobox to set the Report title by using the Set Value (VBA or Macro), if you use the =[forms]![yourformname]![comboboxname] method, then the combobox will have to be there EVERY time a user opens the report.

Then on close button of the form, use a macro that does this

- Ask if user want to set Report title to [Report Title], which should already be stored in the report title label
- If choose YES, then close form, and then delete form AND table that is storing Report Titles that the Combobox is looking up (Or keep it in case you need to use it again for some reason).
- If choose NO, bring back user to the form to choose again.

A macro might not have the options you need so VBA might be required.

Hope this helps!
 
Last edited:
Thanks for the help guys. I've decided to make the "shop selection" an item on the switchboard and put a note at the bottom in big red letters advising the user to select their shop first. I appreciate all the help.
 

Users who are viewing this thread

Back
Top Bottom