query with drop-down menu

T

tracktraining

Hi All,

I wrote the following query for a report.

SELECT A.FirstName, A.LastName, A.DocID, A.Revision, A.DateCompleted,
A.JobFunc
FROM LatestRev AS A
WHERE ((([Enter Document Number])=A.DocID) And (([Enter Job
Function])=A.JobFunc))
ORDER BY A.FirstName, A.LastName, A.Revision;


The place where I have [Enter Job Function], this allows the user to enter a
job function, BUT is there a way to have it to be a drop-down menu and then
the user can just select the job function?

- Thanks,

Tracktraining
 
J

John W. Vinson

Hi All,

I wrote the following query for a report.

SELECT A.FirstName, A.LastName, A.DocID, A.Revision, A.DateCompleted,
A.JobFunc
FROM LatestRev AS A
WHERE ((([Enter Document Number])=A.DocID) And (([Enter Job
Function])=A.JobFunc))
ORDER BY A.FirstName, A.LastName, A.Revision;


The place where I have [Enter Job Function], this allows the user to enter a
job function, BUT is there a way to have it to be a drop-down menu and then
the user can just select the job function?

Certainly. Create a little unbound form frmCrit and put a combo box on it
named cboJobDocumentNumber, based on a query selecting all distinct job
numbers; use a criterion

A.DocID = [Forms]![frmCrit]![cboJobDocumentNumber]

To the same for job functions.

It's convenient to open this form *INSTEAD* of the report, and put a command
button on the form to open the report; or, you can open frmCrit in the
report's Open event, and close it in the report's Close event.
 
T

tracktraining

thank you. I will take the form approach then.

--
Learning


John W. Vinson said:
Hi All,

I wrote the following query for a report.

SELECT A.FirstName, A.LastName, A.DocID, A.Revision, A.DateCompleted,
A.JobFunc
FROM LatestRev AS A
WHERE ((([Enter Document Number])=A.DocID) And (([Enter Job
Function])=A.JobFunc))
ORDER BY A.FirstName, A.LastName, A.Revision;


The place where I have [Enter Job Function], this allows the user to enter a
job function, BUT is there a way to have it to be a drop-down menu and then
the user can just select the job function?

Certainly. Create a little unbound form frmCrit and put a combo box on it
named cboJobDocumentNumber, based on a query selecting all distinct job
numbers; use a criterion

A.DocID = [Forms]![frmCrit]![cboJobDocumentNumber]

To the same for job functions.

It's convenient to open this form *INSTEAD* of the report, and put a command
button on the form to open the report; or, you can open frmCrit in the
report's Open event, and close it in the report's Close event.
 

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