Thought this would not be tricky, maybe overlooking something. (Hope I'm using the bound terminology properly)
I created a unbound combobox in the header of a form and code in the after update event adds new record using values from all the cols in the combobox. This works well for the bound field. I thought I would extend the capability without having to create another combobox or button on the form, for cases where the user knows the eventcode (another field in the combo) rather than the acro (bound field in the combo), I put code in not in list event which does a dlookup to find the acro based on the eventcode. I tried to get that value back into the combobox and rerun using that, didn't work --combobox remained blank. I was successfully able to pass the eventcode to the after update directly (commented out), which worked for that piece of data, but since the other fields are derived from the combobox and the combobox was not set to the acro, the other fields are null.
I created a unbound combobox in the header of a form and code in the after update event adds new record using values from all the cols in the combobox. This works well for the bound field. I thought I would extend the capability without having to create another combobox or button on the form, for cases where the user knows the eventcode (another field in the combo) rather than the acro (bound field in the combo), I put code in not in list event which does a dlookup to find the acro based on the eventcode. I tried to get that value back into the combobox and rerun using that, didn't work --combobox remained blank. I was successfully able to pass the eventcode to the after update directly (commented out), which worked for that piece of data, but since the other fields are derived from the combobox and the combobox was not set to the acro, the other fields are null.
Code:
Private Sub cboAcro_NotInList(NewData As String, Response As Integer)
'If entering an event code rather than acro,
'try to search for that instead
'20170310
If Not IsNull(DLookup("Acronym", "Courses_Data", "[EVENTCODE] = " & "'" & NewData & "'")) Then
Me.cboAcro = DLookup("Acronym", "Courses_Data", "[EVENTCODE] = " & "'" & NewData & "'")
Me.cboAcro.Requery
'Call DisplayProduct(NewData)
End If
End Sub