ScottK1396
Registered User.
- Local time
- Today, 10:17
- Joined
- Jul 28, 2011
- Messages
- 20
TWIMC
I write you as an intermediate part-time Access developer. So, “hit the books” can be a valid answer. However, I believe a couple extra applied brain cells can help me with something I’m overlooking.
I have an Access form that helps process a work list among the different offices in my company. The form has a list box that is used to display a record with code behind OnClick.
I adopted code from [http: // allenbrowne.com / ser-03.html] to use on a list box, and it has worked in the past. The list box displays a subset of the table, filtered on status and location (no joins). The search is keyed on the autonumber ID field the control is bound to.
However, it will error out (“Not Found: Filtered?” as seen in the code) when I select a record of a certain type of upgrade (field value), which is displayed in the list but is not the bound field.
The data is on a SharePoint, and has a couple of nested-recordset fields (they aren’t involved in the list box, but are displayed on the form)
The record exists, obviously; I see it in the table, and it would not be in the list otherwise. What could it breaking on? Should I be using the same method for a list box as I would for a combo?
More info
lstComputers – list box
RowSource = SELECT ID, User_DispName, Comp_Name, Upgrade_Target FROM Processing_
WHERE (Site=[cboSite] AND Status = "Interview") ORDER BY User_DispName;
BoundColumn = 1 {AutoNumber ID field}
RowSourceType = Combo/Query
ColumnCount= 4
ColumnWidths = 0";1";1";0.75"
Code (from http: // allenbrowne.com / ser-03.html )
Private Sub lstComputers_Click()
Dim rs As DAO.Recordset
If Not IsNull(Me.lstComputers) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[ID] = " & Me.lstComputers
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
I write you as an intermediate part-time Access developer. So, “hit the books” can be a valid answer. However, I believe a couple extra applied brain cells can help me with something I’m overlooking.
I have an Access form that helps process a work list among the different offices in my company. The form has a list box that is used to display a record with code behind OnClick.
I adopted code from [http: // allenbrowne.com / ser-03.html] to use on a list box, and it has worked in the past. The list box displays a subset of the table, filtered on status and location (no joins). The search is keyed on the autonumber ID field the control is bound to.
However, it will error out (“Not Found: Filtered?” as seen in the code) when I select a record of a certain type of upgrade (field value), which is displayed in the list but is not the bound field.
The data is on a SharePoint, and has a couple of nested-recordset fields (they aren’t involved in the list box, but are displayed on the form)

More info
lstComputers – list box
RowSource = SELECT ID, User_DispName, Comp_Name, Upgrade_Target FROM Processing_
WHERE (Site=[cboSite] AND Status = "Interview") ORDER BY User_DispName;
BoundColumn = 1 {AutoNumber ID field}
RowSourceType = Combo/Query
ColumnCount= 4
ColumnWidths = 0";1";1";0.75"
Code (from http: // allenbrowne.com / ser-03.html )
Private Sub lstComputers_Click()
Dim rs As DAO.Recordset
If Not IsNull(Me.lstComputers) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[ID] = " & Me.lstComputers
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