How can I search a field in an Access database for a number and display that record?
Printable View
How can I search a field in an Access database for a number and display that record?
Guess you have to use a SQL Query.
For example, you have a field which stores numbers in a table in an Access database.
Table = sales
Field = invoice_num
So, you would like to search for a particular invoice number like '123', so you build a SQL string like this
SELECT invoice_num
FROM sales
WHERE invoice_num = 123
The WHERE clause of the SQL query would give you the condition as to what number you want to look for, unless you are looking for a pattern in a field, then, that is another story.
Hope this helps...
____________________________________
The VB Bugs in my Life...
u can use a Select query as
str="Select * from table name where field =123 "
in sql server user
str=Select * from dsn.dbo.table name where field =123
Sudharshaan