Unanswered: want a code to open selected recordset
i need a code to open only the user specified records from the recordset
ie if a record contain some 50 records and i want to select only the records from 10 to 18 .
how can i do this
someone write me the code with example
If, for example, you wanted the user to specify the records from, say, a list box, you could put this in the afterupdate of the listbox.
Private Sub RecordList_AfterUpdate()
' Print the list of selected items to the text
' box txtSelected.
Dim varItem As Variant
Dim StrList As String
Dim Db as Database
Dim Rs as Recordset
Set Db = Currentdb()
' Here's the code for selecting the records
If .MultiSelect = 0 Then
Me!txtselected = .Value
For Each varItem In .ItemsSelected
StrList = StrList & .Column(0, varItem) & " or [recordID] = "
'Open the recordset
set rs = db.openrecordset("select * from [yourtable] where " & StrList)