View Full Version : Option Group to fill in text box based on combo box .. is this possible???


fatkid77
09-12-2000, 06:12 AM
I have an form that has an Combo box,option group and a textbox.

Combo Box for Store Name
Option Group
()Apple
()Oranges
()Pears
and a text box to display the cost depending on the store.
All this data is stored in another table Customers.

In a table i have a cost for each of these depending on the Store.

tblStore
fldStoreName
fldApple
fldOrange
fldPears

I want to be able to check the appropiate check box (either apple,oranges,pears) and show the cost for that store (from the combo box)

Hopefully this makes sense.

Please help

Travis
09-12-2000, 10:14 AM
make your store combo box 4 columns.

fldStoreName,fldApple,fldOrange,fldPears

make sure the last three columns widths are 0". So they are not visible

()Apple (Assumed Option Value = 1)
()Oranges (Assumed Option Value = 2)
()Pears (Assumed Option Value = 3)

with the values set as the Assumed they will correspond with the Columns (0 = first column, 1 = second column ...)

Then on the AfterUpdate of both the combobox and the OptionGroup (You need to do both as they both effect the answer in your text box) add this code:

me.[TextBoxName] = Me.[ComboBoxName].column(me.[OptionGroupName])

Hope this helps.