In SubForm Find the record that matches the control

Joined
Mar 29, 2008
Messages
3
Reaction score
0
Hi
Can someone help me
In the subForm I have a dropdown box to Find the record that matches the control. This is the code I have and works on the form that is not a subform.

I get an msg that says Not found: filtered?" because this dropdown control is in a subForm.
I don't know how to reference that it is in a subform.

The Main Form ID is named - ModuleID
The Sub Form ID is named - QADocumentationID
DropDown box in the subform is named - FindItpNo


Private Sub FindItpNo_AfterUpdate()
' Find the record that matches the control.
Dim rs As DAO.Recordset

If Not IsNull(Me.FindItpNo) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[QADocumentationID] = " & Str(Me![FindItpNo])
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
End Sub

Thanks BBryan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top