unbound combo box

  • Thread starter Thread starter MSD
  • Start date Start date
M

MSD

Hi,

I am designing a form that allows users to change information in the
underlying table. To find the right record to change, I want them to be able
to choose the ItemNumber from a combo box.

I am using an unbound combo box, where the record source is a SQL statement:

SELECT ItemNo, ItemName from tblItems;

I also have a hidden field on the form, where the control source is:
=[ItemNo]

When the combo box gets the focus, it is supposed to get its value from the
hidden field.

It is not working. When the form opens, there is nothing shown in the combo
box. I can select an item number from the drop-down list, but nothing else
in the form changes (i.e. Item Name, Item Description). In other words, I am
not getting it to go the the record selected in the combo box - I used the
combo box wizard, so I think the VB code is okay - It is supposed to find
the record where the ItemNo = the value in the combo box.

Thanks very much,

Emma
 
Hi,

I am designing a form that allows users to change information in the
underlying table. To find the right record to change, I want them to be able
to choose the ItemNumber from a combo box.

I am using an unbound combo box, where the record source is a SQL statement:

SELECT ItemNo, ItemName from tblItems;

I also have a hidden field on the form, where the control source is:
=[ItemNo]

When the combo box gets the focus, it is supposed to get its value from the
hidden field.

It is not working. When the form opens, there is nothing shown in the combo
box. I can select an item number from the drop-down list, but nothing else
in the form changes (i.e. Item Name, Item Description). In other words, I am
not getting it to go the the record selected in the combo box - I used the
combo box wizard, so I think the VB code is okay - It is supposed to find
the record where the ItemNo = the value in the combo box.

You may need to requery the combo box, or set its value to ItemNo, in
the Form's Current event. Also, there may indeed be something wrong
with the wizard's code - care to post it?
 
Back
Top