Form field not being passed to query as criteria

Shrout1

New member
Local time
Today, 12:06
Joined
Jul 30, 2012
Messages
7
Instead of the combo box value being passed into the target query as it should I *always* receive a popup that states "Enter Parameter Value"

I set my filter criteria as such in the target query: "[Forms]![Invoice_Form]![comboFamily]" but for some reason, despite there being a value in that combo box, I am always prompted for a parameter. VBA code associated with a "Generate Invoice" button on the form causes the query and the report to open.

I've attached the database, everything is dummy data.

The suspect form is the "Invoice_Form" the suspect query is the "Invoice_Query" and the suspect report is the "Invoice".

If a number is entered in the "Enter Parameter Value" field that matches the primary key of a family in the "Family" table then a report is generated correctly (as it is currently configured). For some reason it seems that the form with the combo box just cannot be accessed by the query.
 

Attachments

Check the spelling of the form name.

Invoice_Forrm ?
 
Check the spelling of the form name.

Invoice_Forrm ?

Hard to believe I didn't see that! It's funny how typical this kind of post is and how I was *certain* that I wasn't making that kind of mistake...

One more question - on the form itself I have combo boxes with 2 columns being referenced. Is there an easy, non code way to have the combo box value be the user ID or the "number" for the month (4 for April) and yet have the combo box contain the full text of the user ID's name or the full text of the month name?

I.E. use column 1 value, display column 2 text :)
 
Looks like this thread has the answer!
(Can't add links until 10 posts! Just add the www in front of that)

techonthenet.com/access/comboboxes/bind_index.php

Let me know if that looks right... I'll test it this evening (What better way to spend a Friday night, eh?)
 
YEs. That is basically what you want.

If you want the month number as a column in the combo then include this term in the RowSource query:

Month([somedatefield]) As MonthNumber

Alternatively, if you use a ValueList as the rowsource just separate the values with semicolons.

January;1;February;2;March;3 ..........

2 as the ColumnCount will set them out how you need. Then just define the BoundColumn and ColumnWidths as explained in the article.
 

Users who are viewing this thread

Back
Top Bottom