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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to be able to search for a record using vb code?

Status
Not open for further replies.

gnibbles

Programmer
Mar 15, 2000
79
CA
Im doing up a database to keep track of records and im using a switcboard to keep track of it all and I want to be able to search for a record using vb code. If anyone could help Id appreciate it thanks.
 
Minimal SQL needs<br><br> Dim db as database, rst as recordset, SQL as string<br> Set db = CurrentDb<br> ' SQL string.<br> SQL = &quot;SELECT * FROM Orders WHERE OrderDate &gt;= #1-1-95#;&quot;<br> Set rst = db.OpenRecordset(SQL) <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
You can also use the Index and Seek routines with RecordSet.
 
here is what I have so far, its not really runnin properly and Im pretty much a novice yet so I dont really know whats wrong.<br><br>Private Sub cmd_find_Click()<br>'set the sql statement and set the list box recordsource<br>Dim myDb As Database<br>Dim myRst As Recordset<br>Set myDb = CurrentDb<br>Dim sql As String<br><br><br>sql =
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top