Results 1 to 2 of 2

Thread: VBA and Access

  1. #1
    Join Date
    Jan 2010

    Unanswered: VBA and Access

    I need some good tutorials of VBA and Access. I need update, select, delete, and insert statements and best way to use those within VBA and access.


  2. #2
    Join Date
    Dec 2004
    Madison, WI
    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:
    docmd.openquery "MyQueryName"

    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. 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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts