Combo box won't close

thart21

Registered User.
Local time
Yesterday, 19:15
Joined
Jun 18, 2002
Messages
236
I have a form with a combo box and "notinlist" event. The "notinlist" event opens a 2nd form to add the new document. When I click "Save" or "Cancel" closing the 2nd form and returning focus to the 1st, the dropdown box is already opened on the 1st. I cannot figure out the code to keep it from opening automatically.

Any push in the right direction would be appreciated!

Thanks,

Toni
 
Here is some code I used for a form's notinlist event - the important thing to do is set the value of your combobox field to null:

Private Sub ClientID_NotInList(NewData As String, intresponse As Integer)
On Error GoTo ClientNotinListErr


intresponse = MsgBox("'" & NewData & "' is not in the system. Do you want to add?", vbYesNo)
If intresponse = vbYes Then

DoCmd.OpenForm "frmClients", acViewNormal, , , acFormAdd

Me.ClientID.Value = Null

Else
Exit Sub
End If

ClientNotInListExit:

Exit Sub

ClientNotinListErr:
Resume ClientNotInListExit


End Sub

HTH :)
 

Users who are viewing this thread

Back
Top Bottom