Re: drop down list within a query?



Hi Fred, i am afraid i am not having any luck with this.
Firstly when i set the column width it reverts back to 0cm;2.54cm. I am not
sure if this is the same (2.54cm being 1 inch?)

Next when i add the code "me.visible = false" i get an error message,
regarding no such macro as "me"






"fredg" wrote:

On Tue, 16 Jan 2007 12:40:01 -0800, Maax wrote:

Hi Fred, yes the query will be used for a report. Although your instructions
are clear I am having trouble with this. I will carry on trying though as i
am sure i will get it correct through trial and error.

"fredg" wrote:

*** Snipped ***

You'll need to use a form to do this.

Let's assume it is a CustomerID number you need as criteria.

Make a new unbound form.
Add a combo box that will include the CustomerID field as well as the
CustomerName field.
Make sure the Combo Box Bound Column is the
CustomerID field (the first column)

Set the Column Width property of the combo to
0";1"

Add a command button to the form.
Code the button's Click event:
Me.Visible = False
Name this form "ParamForm"

Code the Report's Record Source Query's CustomerID field criteria
line:
forms!ParamForm!ComboBoxName

Code the Report's Open Event:
DoCmd.OpenForm "ParamForm" , , , , , acDialog

Code the Report's Close event:
DoCmd.Close acForm, "ParamForm"

Run the Report.
The report will open the form.

Find the CustomerName in the combo box.
Click the command button.

The report will display just those records for the Customer selected.
When the Report closes it will close the form.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

.