J
JeanetteJH
I have a inventory details form that has 2 unbound combos on it. The first
combo is for the supplier and the second one if for the part number. The
part number is filtered by the supplier so that the only parts that show up
in this combo is the part numbers that that supplier supplies to us. The
rest of the form contains details about the part. I would like to be able to
go to the record where my InventoryID (bound to table) is equal to my
cboItemId after it is filtered. I have used the following code (Thanks to
Allen Browne):
Sub CboItemID_AfterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.cboItemID) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
Debug.Print "[InventoryID]=""& Me.cboItemID"""
rs.FindFirst "[InventoryID] = "" & Me.cboItemID"""
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
The only thing that I get is the MsgBox "Not found: filtered?"
Any help will be greatly appreciated.
Jeanette
combo is for the supplier and the second one if for the part number. The
part number is filtered by the supplier so that the only parts that show up
in this combo is the part numbers that that supplier supplies to us. The
rest of the form contains details about the part. I would like to be able to
go to the record where my InventoryID (bound to table) is equal to my
cboItemId after it is filtered. I have used the following code (Thanks to
Allen Browne):
Sub CboItemID_AfterUpdate()
Dim rs As DAO.Recordset
If Not IsNull(Me.cboItemID) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
Debug.Print "[InventoryID]=""& Me.cboItemID"""
rs.FindFirst "[InventoryID] = "" & Me.cboItemID"""
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
The only thing that I get is the MsgBox "Not found: filtered?"
Any help will be greatly appreciated.
Jeanette