combo box auto update multi fields

  • Thread starter Herman Wellington
  • Start date
H

Herman Wellington

Hi,

I look thru some related message and found I have similar problem. I
learned from here the below but it couldn't work in my form which as a
subform.

me.field1=me.combobox.column(1)
me.field2=me.combobox.column(2)

It work fine in single form but no in a form with subform. How could I come
around it.

Thanks.
Herman W.
 
K

Klatuu

You don't say which form the combo box is on, which form the text boxes are
on, nor in which event to code is. It makes a difference.

I am assuming the code is in the After Update event of the combo box.

If the combo box in on the main form and the text boxes are on the subform:

me.field1=me.MySubformControlName.form.combobox.column(1)
me.field2=me.MySubformControlName.form.combobox.column(2)

If the combo is on the subform and the text boxes are on the main form:

me.Parent.field1=me.combobox.column(1)
me.Parent.field2=me.combobox.column(2)
 
H

Herman Wellington

Hi Klatu,

Sorry I didn't mention. You are right, it is on "After Update" event. Both
the combobox and the field I want to update is on the main form. Therefore,
I test it without subform then it works.

Regards,
Herman W.
 
Top