combo box to populate another field

T

Tracy

I have a combo box that has a list of items, then the next field is "price".
I am wanting to be able to select an item and have the "price" automatically
come up in the "Price Field Box". I am not sure what I need to do. Any help
would be greatly appreciated.
 
G

Guest

Assuming that you have both the Item and the price in the same table (would
be sensible) you can easily create a small query to act as the source of the
combo with 2 columns. 1 would be the item and 2 would be the price.

Set the combo to display the item and an unbound box to be the 2nd column of
your combo.

=[ComboName]!colum1 (don’t forget columns start from 0 so the 2ns column
is col 1)

If you don’t know how to create the small query then you can use the wizard
– right click the combo and on the properties box go to the Date column and
select Row Source Type as Table/Query and click the … (build) for the wizard
to help you build the query.

Hope this helps
 
T

Tracy via AccessMonster.com

Ok, I created the query and in the combo box I can view the data that I want.
I also created an Unbound field and in the Control Source I entered =
[Device Type]!column1. I get an #Error message. What am I missing?

Tracy

Wayne-I-M said:
Assuming that you have both the Item and the price in the same table (would
be sensible) you can easily create a small query to act as the source of the
combo with 2 columns. 1 would be the item and 2 would be the price.

Set the combo to display the item and an unbound box to be the 2nd column of
your combo.

=[ComboName]!colum1 (don’t forget columns start from 0 so the 2ns column
is col 1)

If you don’t know how to create the small query then you can use the wizard
– right click the combo and on the properties box go to the Date column and
select Row Source Type as Table/Query and click the … (build) for the wizard
to help you build the query.

Hope this helps
I have a combo box that has a list of items, then the next field is "price".
I am wanting to be able to select an item and have the "price" automatically
come up in the "Price Field Box". I am not sure what I need to do. Any help
would be greatly appreciated.
 
L

LanWanMan

Tracy,

In the form containing the combo box, highlight the combo box and hit F4 for
properties of the combo box.

Goto the event tab and in the "After Update" field, select "Event
Procedure". Click on the "..." button and select "Code Builder".

Use code similar to this:

Private Sub EmpLast_AfterUpdate()
Price.Value = LIST.Column(X)
End Sub

Where "LIST" is the field name bound to the combo box and X is the column
number. Remember to begin the column count at 0.

Hope this helps.

Michael
 
T

Tracy via AccessMonster.com

I don't understand what Price.Value is. My combo box is named [combocrop]
the two fields that it lists are crop and date. My combo box lists the crop
and I want the corresponding date to come into the unbound field.
thanks.
Tracy,

In the form containing the combo box, highlight the combo box and hit F4 for
properties of the combo box.

Goto the event tab and in the "After Update" field, select "Event
Procedure". Click on the "..." button and select "Code Builder".

Use code similar to this:

Private Sub EmpLast_AfterUpdate()
Price.Value = LIST.Column(X)
End Sub

Where "LIST" is the field name bound to the combo box and X is the column
number. Remember to begin the column count at 0.

Hope this helps.

Michael
I have a combo box that has a list of items, then the next field is
"price".
[quoted text clipped - 3 lines]
help
would be greatly appreciated.
 
T

Tracy via AccessMonster.com

Hi Wayne
Sorry so long.
I can get the unbound box to list the first column data, but not the second
column data. What am I missing.
Thanks

Wayne-I-M said:
Assuming that you have both the Item and the price in the same table (would
be sensible) you can easily create a small query to act as the source of the
combo with 2 columns. 1 would be the item and 2 would be the price.

Set the combo to display the item and an unbound box to be the 2nd column of
your combo.

=[ComboName]!colum1 (don’t forget columns start from 0 so the 2ns column
is col 1)

If you don’t know how to create the small query then you can use the wizard
– right click the combo and on the properties box go to the Date column and
select Row Source Type as Table/Query and click the … (build) for the wizard
to help you build the query.

Hope this helps
I have a combo box that has a list of items, then the next field is "price".
I am wanting to be able to select an item and have the "price" automatically
come up in the "Price Field Box". I am not sure what I need to do. Any help
would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top