default values in combo box with multiple colimns

  • Thread starter Thread starter mitja
  • Start date Start date
M

mitja

Hi,
I have a combo box (cmbSEG_ETY_ID) that is filled with values from a table
SELECT RPT_EMPLOYEE_TYPES.ETY_ID, RPT_EMPLOYEE_TYPES.ETY_NAME FROM
RPT_EMPLOYEE_TYPES; (employee ID and employee NAME), where employee NAME is
visible and employee ID is linked column (column 1).
When a form opens a combo box is empty and a user has to select one product.
I want to change this so when a form opens, combo box would already have a
name of the first product NAME filed in and a product ID somewhere (?)

I tried to set Default value to:
=[cmbSEG_ETY_ID].ItemData(0)
doesn't work

I tried to use the load procedure Private Sub Form_Load():
Me.cmbSEG_ETY_ID.Value = Me.cmbSEG_ETY_ID.ItemData(0)
doesn't work

What to do?
Thanks
Mitja
 
Open the form in design view, click on the combo, double click, scroll down,
and select Properties.
Enter an ID value in the Default Value property.
 
Back
Top