|
-
Mar 28th, 2000, 01:37 AM
#1
Thread Starter
Lively Member
I am using the below code to search for a particular user or asset tag# in a database. The code works fine, the problem is after I search for the user, my back and forward buttons no longer scroll through database. Any help is appreciated.
If optUser.Value = True Then
Dim UserName As String
UserName = InputBox("Which User would you like to search for?")
datComputers.RecordSource = "select * from Computers " & _
"where UserID = '" & UserName & "'"
datComputers.Refresh
Else
Dim AssetTag2 As String
AssetTag2 = InputBox("Which AssetTag would you like to search for?")
datComputers.RecordSource = "select * from Computers " & _
"where AssetTag = '" & AssetTag2 & "'"
datComputers.Refresh
End If
-
Mar 28th, 2000, 10:02 PM
#2
Lively Member
With the code you provided, you set the RecourdSource (the recordset) the form shows. I assume that the asset# is unique. You the have only one record in your recordset after runnig the code. That's why you scroll buttons wont work anymore.
A possible solution is either using the 'find' method or provide a reset button thet rests the recordsource.
Roger
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
|