Combobox problem

Frodo

Registered User.
Local time
Today, 07:30
Joined
Mar 1, 2006
Messages
23
Im using a combo-box on a form that the user can select a name and when that name is selected ( a query will run ) and a report will give the results.

My problem is that i have duplicates in the combo-box and when the reports prints out all the names in the database are printed instead of that one name the user selected.

Any help would be great.

regards
Frodo form Iceland
 
My problem is that i have duplicates in the combo-box

Sounds like you need to use SELECT DISTINCT in your row source for the combo. e.g. SELECT DISTINCT [TableName].[Name] From [TableName]


and when the reports prints out all the names in the database are printed instead of that one name the user selected.

Have you referenced the query to the combo box on the form in its criteria i.e. Under the name field in the query used [Forms]![NameofForm]![comboname]?

Also is the form still open when the query runs?
 
Also, if you want just that selection from the combo box, you can avoid referencing the combo box in the query itself by opening the report using a Where Clause -

DoCmd.OpenReport "YourReportNameHere", acViewPreview, , "[YourFieldNameHere]=" & Me.YourComboBoxNameHere
 

Users who are viewing this thread

Back
Top Bottom