I have a Search combo box which is a unbound control on a form that opens up a large table [Sleep]. I am not sure where this came from, but it works OK. This is the code that I have in the AfterUpdate()
Private Sub Search_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Me![Search])
Me.Bookmark = rs.Bookmark
End Sub
In the properties of this combobox:
RowsourceType: Table/Qwery
Rowsource: SELECT[Sleep].[ID],[Sleep].[Last Name] FROM Sleep;
Now then: I have created a Qwery [Done] that pulls up only those records that meet a certain criteria (eg. Done=Yes), and have created a Form based on this Qwery. I want to place a similar Search ComboBox that would look up the Last Name in the Qwery (not the original table). It has to Autofill too. I have tried the above code but it doesn't work. What am I doing wrong?
Please help
Thanks
Luis
Private Sub Search_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Me![Search])
Me.Bookmark = rs.Bookmark
End Sub
In the properties of this combobox:
RowsourceType: Table/Qwery
Rowsource: SELECT[Sleep].[ID],[Sleep].[Last Name] FROM Sleep;
Now then: I have created a Qwery [Done] that pulls up only those records that meet a certain criteria (eg. Done=Yes), and have created a Form based on this Qwery. I want to place a similar Search ComboBox that would look up the Last Name in the Qwery (not the original table). It has to Autofill too. I have tried the above code but it doesn't work. What am I doing wrong?
Please help
Thanks
Luis