This is one I used some time ago. It opens a form that allows the entry to be edited if there is more than appears on the Combo box
In the NotInList event of the combo box:
Private Sub cboSiteIDAll_NotInList(NewData As String, Response As Integer)
Dim cbo As ComboBox, strMsg As String
Set cbo = cboSiteIDAll
strMsg = "This site is not in the list. Would you like to add it?"
If MsgBox(strMsg, vbOKCancel) = vbOK Then
Response = acDataErrAdded
DoCmd.OpenForm "Frm_Sites", , , , acFormAdd, acDialog, NewData
Else
cbo.Undo
Response = acDataErrContinue
End If
End Sub
In the On Load event of the form that is being opened use the following
Private Sub Form_Load()
Dim VarX As String
With Me
.NavigationButtons = False
.RecordSelectors = False
!St_Description = Me.OpenArgs
End With
VarX = DLookup("[CL_Client_ID]", "Tbl_Clients", "[CL_Client_ID]= '" _
& Forms![Frm_Movements_Single]![cboMov_Client_ID] & "'"

Me.St_Client_ID = VarX
End Sub
Delete out the VarX bit, as you can see it fills in a client ID in another
Text Box
Neil Berryman
IT Trainer
neil_berryman@btopenworld.com