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

Select Query in VBA

Status
Not open for further replies.

3239

Technical User
May 14, 2003
64
I'm new at writing queries in VBA. I Just wanted to know if it is possible to write select queries in VBA and if so, how?

Thanks.
 
Use a Recordset.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
An easy way to start is to develop a query in query design view, then change views to SQL view. This will give you an idea of the SQL you will need to SELECT from your recordset.

If quizzes are quizzical, what are tests?
 
The answer is yes. The real question is what do you want to do?

A Recordset will allow you to programmatically manipulate or read the records. You can create a DAO Querydef object (query) and set it's Sql property and you have a query. You might set the recordsource property of a form or report to an SQL string in VBA. You may also mean you want to build a select statment based on selections of things on a form.

So what is it you are REALLY trying to do?
 
3239,

Did you ever made any sort of decision on this? Where are you at with your project or whatever?

--

"If to err is human, then I must be some kind of human!" -Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top