Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help Please

0 views
Skip to first unread message

Verne H. Bohlender

unread,
Dec 15, 2000, 1:26:49 PM12/15/00
to
I have been using this code to find my people using ADO and the Jet 4
engine but when used it locks me in that name range. e.g. If I search
for Johnson I get Johnson and if more than one exixt I can navigate to
them and back but the rest of the database is locked out to me after
this until I close and run the program again. Before running the
search I can go to any part of the database I want to go. Would some
kind sole help a newby to VB find a cure for this little problem.
Even a hint on the right way may help this 71 year old kid learn a
little more. Please

Private Sub cmdFind_Click()
Dim sLastName As String
Dim sSQL As String

'Build SQL QUERY
sSQL = "SELECT * from Customer"
sLastName = InputBox$("Enter Last Name:")
If sLastName <> "" Then sSQL = sSQL & " WHERE LastName ='" &
sLastName & "'"

'UPDATE THE ADO DATA C0NTROL
Customer.CommandType = adCmdText
Customer.RecordSource = sSQL
Customer.Refresh

End Sub

Patrick Goupell

unread,
Dec 15, 2000, 4:26:58 PM12/15/00
to
When you are done looking at the selected records for 'lastname', then
you must reset the select statement to 'select * from table' - leaving
off the where clause.

--
Patrick Goupell

http://www.nite.org
http://www.noneusa.org


Verne H. Bohlender

unread,
Dec 19, 2000, 7:53:29 PM12/19/00
to
In this vein also would anyone tell me how to convert the code below
to read both LastName and FirstName Fields, Please
0 new messages