|
-
Jul 17th, 2007, 02:47 AM
#1
Thread Starter
Hyperactive Member
[2005] Search
Hi how do i make a Search txtbox?
anyone help me with the codes?
ex. my table name is EmployeeProfile and i want to search the employeeID's in that table
-
Jul 17th, 2007, 03:27 AM
#2
Re: [2005] Search
What have you got so far?
-
Jul 17th, 2007, 03:29 AM
#3
Thread Starter
Hyperactive Member
Re: [2005] Search
a textbox named txtSearch and an a button, basically nothing yet on codes pretty clueless thanx
-
Jul 17th, 2007, 03:33 AM
#4
Re: [2005] Search
I suggest you search the forums first. There are literally hundreds of examples on SQL and searching for records. Here's an example in the code bank. I think you will probably be most interested in example 2.
http://www.vbforums.com/showthread.php?t=469872
-
Jul 17th, 2007, 03:37 AM
#5
Thread Starter
Hyperactive Member
Re: [2005] Search
hmm what i want t odo is search an employee ID then when i click search btn, it displays in the form including all the details, i already have everything except for the search so instead of using a button next,previous,last,first.. i want a search txtbox so thjat ill just be inputting the id number of the mployee view his/her data
-
Jul 17th, 2007, 03:44 AM
#6
Re: [2005] Search
So you have all the SQL code already??
Well then, you would add the search as a parameter. When you declare your SQL search term you would just add this on the WHERE clause:
WHERE employeeID = @Search
Then where you have declared your SQL select command you add it as a parameter (this assumes sqlSel has been delcared as a SQL statement):
vb Code:
sqlSel.Parameters.AddWithValue("@Search", Me.Textbox1.text)
Perform your search as you would do.
-
Jul 18th, 2007, 03:16 AM
#7
Thread Starter
Hyperactive Member
Re: [2005] Search
i have everything except ALL the codes for inputting a search function txtbox
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
|