combo box afterupdate

slimjen1

Registered User.
Local time
Yesterday, 19:06
Joined
Jun 13, 2006
Messages
562
All, using access 2010. I have a main form with a combo box trying to search a subform. The combo box is named cboSSN and the recordsource is a qry that contains the SSNs. The parent and child links are SSN. I want to select a SSN from the combo and in the afterupdate; view the subform record. I used this code several times but for some reason doesnt work now.
Code:
Dim strInvoice As String

'Look for the Invoice number in the Ship Info table based on the PRO number entered in the search box.
strInvoice = Nz(DLookup("SSN", "qryMaster", "SSN=""" & Me.cboSSN & """"), "")

If strfilter <> "" Then 'ssn number was found so reset the bookmark based on the returned Invoice number.
    If Me.Dirty Then Me.Dirty = False
    With Me.RecordsetClone
        .FindFirst "SSN=""" & strfilter & """"
        Me.Bookmark = .Bookmark
    End With
Else 'SSN number was not found so display a message box
    MsgBox "The SSN number you entered was not found."
End If

'Clear the search box.
Me.SSN = ""

Can anyone see what's wrong.
 
In one place you use the name strInvoice and in other places you use the name strfilter.
 
sorry. this is a typo when typing the code for this forum . i ran the correct code with strFilter. I still get the same error.Thanks.
 
sorry. this is a typo when typing the code for this forum . i ran the correct code with strFilter. I still get the same error.Thanks.
The show the code you exactly have, (copy it not type it in), it could be more typo in it.
 

Users who are viewing this thread

Back
Top Bottom