Hi
I am working on a Access database. One of the forms allows adding or updating a record, with validation done in VBA. A field on here is a combo box to allow the user to select a member of staff as the contact for this record.
When adding a record this works fine, with the drop down box being population from a small bit of SQL, having the record ID (key) and the name. When updating an existing record I need to assign the previously selected record to the combo box, and this I can do by using frm.combobox.value = "Fred Bloggs".
The problem is that if it is an add (or an update where the staff member field has changed) and the user selects the record the ID field is returned. If it is an update where the staff member is not updated then the assigned value is returned.
How can I assign an initial value to the combo box which will be processed consistantly?
All the best
Keith
I am working on a Access database. One of the forms allows adding or updating a record, with validation done in VBA. A field on here is a combo box to allow the user to select a member of staff as the contact for this record.
When adding a record this works fine, with the drop down box being population from a small bit of SQL, having the record ID (key) and the name. When updating an existing record I need to assign the previously selected record to the combo box, and this I can do by using frm.combobox.value = "Fred Bloggs".
The problem is that if it is an add (or an update where the staff member field has changed) and the user selects the record the ID field is returned. If it is an update where the staff member is not updated then the assigned value is returned.
How can I assign an initial value to the combo box which will be processed consistantly?
All the best
Keith