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
Printable View
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
What have you got so far?
a textbox named txtSearch and an a button, basically nothing yet on codes pretty clueless thanx
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
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
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.
i have everything except ALL the codes for inputting a search function txtbox