Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help setting up a search button to search access db

Status
Not open for further replies.

tmidgett

MIS
Joined
Nov 21, 2003
Messages
3
Location
US
Hi I am new to vb6 I used the wizard to set up a form in vb6 to access a access 2000 database. It works great I want to add a button to search the LastName field in my table. I have added the label,text box and command button to the form. I double clicked the command button to get to the code screen. I am not sure what code to add to this button to get it to use the textbox to search the lastname field?
Thank Tim
 
Searching can get involved depending on how far you want to go. The main part will be to build the SQL statement. In its simplest form it should end up being similar to,

Code:
"Select * From Table1 Where Lastname =' " & Text1.text & "'"

I would search some of the code respsitory sites for examples. Try or You can find more links at these sites.

Take Care,

zemp

"Show me someone with both feet on the ground and I will show you someone who can't put their pants on."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top