An easy way to learn queries is to start by designing them using the wizard. Since there are many, many different ways to design queries, it's difficult to tell you how to design them but you'd use...
1. An Update query to update data in a table.
2. A Select query to return records in 1 or more tables.
3. A Delete query to delete all the data in a table (or certain data based on criteria)
4. An Append query to append records to a table.
In vba code, you'd run that query as such:
The key to query designing is know how to use criteria and expressions in the query to your advantage. I might suggest looking at some of the examples in the code bank to see how others utilize them. When you start linking tables in a query, it gets a little bit tougher since you want to make sure your relationship is setup correctly and may want to use things such as "Distinct" to return non-duplicated records. But I'd start by practicing creating a few different queries using the wizard.
http://www.dbforums.com/6390529-post84.html here's a method I'm particularly fond of.
Last edited by pkstormy; 02-13-10 at 22:41.
Expert Database Programming
MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)