|
-
Sep 29th, 2000, 10:48 AM
#1
Thread Starter
Addicted Member
I have a textbox named txtsearch and a listbox named list1. When I use this code it only returns the first result and no more. But I really need it to return ALL recordsets where ReportNum = txtsearch. Any Ideas? Preferably by adding to this code.
txtsearch.txt
Set RS = DB.OpenRecordset("SELECT * FROM Main WHERE _ ReportNum = '" & txtsearch.txt & "'", dbOpenDynaset)
List1.AddItem (RS!Place)
RS.Close
End Sub
-
Sep 29th, 2000, 11:11 AM
#2
_______
<?>
this should do it..
if you aren't moving you get only one, the first.
Code:
txtsearch.txt
Set RS = DB.OpenRecordset("SELECT * FROM Main WHERE _ ReportNum = '" & txtsearch.txt & "'", dbOpenDynaset)
rs.refresh
rs.movefirst
While not RS.eof
List1.AddItem (RS!Place)
RS.movenext
Wend
RS.Close
Set RS = Nothing
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Sep 29th, 2000, 11:17 AM
#3
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|