By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,652 Members | 1,484 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,652 IT Pros & Developers. It's quick & easy.

Combo/List Box in Query Question/Problem

P: n/a
I have created form, query and report.

In the form I have a Combo Box which pulls the search criteria
(SaleStatus) from one of my tables. When I select a status and click
on the search button it should run the query and then preview the
report.

The form is an unbound form with the row source type set to
table/query. The row source is a select statement pulling the data from
the table. The Name of the combobox is SaleStatus.

The search button has the following code attached to the on click
event:

Private Sub cmdSEARCH_Click()
DoCmd.OpenReport "rptPROPERTY", acViewPreview
End Sub

The query has the following code in the criteria:
[forms]![fmPROPERTY]![SaleStatus]

Here is what is happening.

If I change the box to a text box and manually type in the status and
click on the command button, the report is previewed with the correct
information being displayed.

If I however, use a Combo Box or a List Box, the data in the previewed
report is blank.

What am I not doing correctly here...

Thanks,

Ray.

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
forget the query and just pass the filter directly in the Open event of
the report.
Sounds like you may have multiple columns in your textbox and you can't
see one of them. check the column count. Make sure you're referencing
the right one.

Listbox... hmm... check www.mvps.org - there's an article there on how
to filter report results based on what's selected in a listbox.

Nov 13 '05 #2

P: n/a
You are correct, when the wizard set up the listbox (and the combo box)
it set up both the index and the content field and bound the first
column (the index ( a hidden column). I changed the bound column to 2
and it works magically.

Thanks for the suggestion, it helped.

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.