How to Run Report Using Combo-Box Criteria

G

Guest

I have two tables. One contains employee names. The other is called
Departments, and it contains only two fields: ID and Department. In the
Employee table, I have a lookup field that goes to Departments for a combo
box list.

I want to run a report that allows me to select which department -
preferably from a list rather than typing in a value.

This should not be too difficult, but I'm having a terrible time with it and
would appreciate ANY help. I've tried QBF, but just am not having any luck
with it.

I ultimately just want to click a button like Run Report by Department and
have a box come up for me to select WHICH department, then display the report.

I am using Access 2000.
 
O

OfficeDev18 via AccessMonster.com

Hi, Anita,

After selecting the department in a combo box, open the report (with a
command button?) and the statement should read, if department is numeric,

DoCmd.OpenReport "ReportName",acViewNormal,"Department = " & Me.ComboBoxName.
Value

if it's string, make it

DoCmd.OpenReport "ReportName",acViewNormal,"Department = '" & Me.ComboBoxName.
Value & "'"

(that is "= <space><single quote><double quote><space> & Me.... &
<space><double quote><single quote><double quote>)

By the way, if you want to display the repot, change acViewNormal to
acViewPreview.

HTH
 

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