Only Second Column in ComboBox Query Will Populate on Form

Old_Timey_User

New member
Local time
Today, 13:46
Joined
Oct 14, 2012
Messages
4
I'm trying to fill out a few fields on my form based on the value selected in my ComboBox. I have a query that selects 4 fields. Column1(subscript 0) of the query is used in the drop down box.

The second column (subscript 1) will populate into Text boxes on the form, but columns 3 and 4 will not. I have zipped the database and attached. All I know about doing this, I copied from this BB.:)

And while I'm at it, one of the returned fields is a currency field. Although I've set the format as currency, it just looks like a number. How can I fix that?

Thanks!

Edit - I'm in Access 2007
 

Attachments

Last edited:
Use column count property in format tab for TO Number combo column count to 4, then set column width something like 2cm;2cm;2cm;2cm

You can adjust column width to set which column you do not want to see in combo.

To show currency and format, I think you have to use like below because as you are using after update, so format set in table level is not working:
Me.TO_Amount = Format(Me.TO_Number.Column(1), "Currency")
Me.PMO_Alloc_Pct = Format(Me.TO_Number.Column(3), "Percent")

But, still after suggesting you possible solutions for your questions, I would suggest you to look at table relationship because you have defined nothing as well as table design. If you do not do this, you are sure to see many obstacles in later stages. Atleast, may be not at the level of an expert but you should do some basic considerations.

regards.
 
Use column count property in format tab for TO Number combo column count to 4, then set column width something like 2cm;2cm;2cm;2cm

You can adjust column width to set which column you do not want to see in combo.

To show currency and format, I think you have to use like below because as you are using after update, so format set in table level is not working:


But, still after suggesting you possible solutions for your questions, I would suggest you to look at table relationship because you have defined nothing as well as table design. If you do not do this, you are sure to see many obstacles in later stages. Atleast, may be not at the level of an expert but you should do some basic considerations.

regards.

Thanks for your suggestions. That does enable me to populate boxes besides just the first and second columns from the query, although the result is not ideal. I don't understand why it is not necessary to define more than one column to get the second column in the query to populate in a text box, but it is for the third, fourth, etc.

As for adding structure, well, yeah. I have big plans, but if I can't get this form to work, we're sticking with Excel.
 

Users who are viewing this thread

Back
Top Bottom