Okay,
I have 1 form with 2 subforms. I have an unbound combo box in the header that is designed to find a record on the form. If the item is not in list, the form should go to a new record and when the combo box loses focus it should go blank.
I have 3 different code events and they are either conflicting or not working and im not sure how/where to combine them to get the above effect.
Here is the code.
Private Sub Combo23_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Me.DataEntry = False ( the form is set to data entry on open so that it is blank)
Set rs = Me.Recordset.Clone
rs.FindFirst "[PartNum] = '" & Me![Combo23] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo23_NotInList(NewData As String, Response As Integer)
Dim rs As Object
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub PartNum_GotFocus()
Me![Combo23] = Null
End Sub
I have 1 form with 2 subforms. I have an unbound combo box in the header that is designed to find a record on the form. If the item is not in list, the form should go to a new record and when the combo box loses focus it should go blank.
I have 3 different code events and they are either conflicting or not working and im not sure how/where to combine them to get the above effect.
Here is the code.
Private Sub Combo23_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Me.DataEntry = False ( the form is set to data entry on open so that it is blank)
Set rs = Me.Recordset.Clone
rs.FindFirst "[PartNum] = '" & Me![Combo23] & "'"
Me.Bookmark = rs.Bookmark
End Sub
Private Sub Combo23_NotInList(NewData As String, Response As Integer)
Dim rs As Object
DoCmd.GoToRecord , , acNewRec
End Sub
Private Sub PartNum_GotFocus()
Me![Combo23] = Null
End Sub