Drop Down Menu

G

Guest

Ok, what I need is to be able to make a Combo Box that will have a list of
items in it. For my need, its a list of my computer models. When I select
the model I want to view, I can click a button under it that will launch a
Report I have already created. The Report runs a query to find all of the
model that I have designated. From the Form editor, I can make a Combo Box
that can run a Query, but I want it to open a form.

Take for example the webpage you on right now. At the top, it has a Combo
box that says Access Database Forms with the "Go" button right next to it.
You make your selection and click the Go button to view that new webpage. I
want this exact thing, but to run a report. Is this possible.

Remember, you are speaking with a new user to Access.
 
G

guido via AccessMonster.com

Well, lets see if I am understanding you correctly. You want to select a
computer model from a combo box and then click a button to open a report that
displays data using that computer model? If I have that correct, this is what
you do. Set up your report to show all of the data. When the user selects a
model from the combo box (I'll call 'drpModel') and clicks the go button
('btnGo') the onclick event would do the following:

Private Sub btnGo_Click()
DoCmd.OpenReport "Model Data", acViewPreview, , "[Cmp Model]='" &
drpModel.Value & "'"
End Sub
 
G

Guest

Ok, some progress was made. Let me give some background.

I have a table called Computer Modelwith a list of computer models that are
at the High School in the school district I work for. I have a larger table
called Input that I use the lookup wizard so I can simply select the model of
computer I am entering. Right now, I have some 700+ entries of several
different model computers. From time to time, I need to print out a report
of each of the models grouped together. The way I have it right now is I
have a query that searches out each model and dumps the data into a report.
Again, I have a report for each model.

On my main form, I have a command button for each computer model that I can
click to produce a report. It works fine, but I want to be able to do this
with all the printers, scanners, LCD projectors, monitors, and anything else
I have in my database. I would prefer to have a drop down list for each
different catagory of components so I don't have a window full of command
buttons.

In the here and now, I put in the code you gave me into my database and it
does call the report I made called Model Data, but the report is empty. The
button I made will open the report, but not get the data form the main table
(Input) according to the model I chose in the drop down list. Does this make
more sense. I know I was kind of vague on the details. I hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top