+ Reply to Thread
Results 1 to 3 of 3

VBA to change access database query

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    VBA to change access database query

    Morning,

    I'm trying to write a piece of code to change the criteria of an access database query.

    I already have a pivot table linked to the database, as part of the macro i need to be able to change the reporting month in the query criteria.

    Is there a way to do this?

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA to change access database query

    Yes - but as you haven't given any specific details it's not easy to give an exact answer.

    In general, you can open a query definition and change the actual SQL statement, or convert the query to a parameter query and then provide the month when running the query. The latter is the easiest option (in my opinion)

  3. #3
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    Re: VBA to change access database query

    So i could have the respective date within the workbook and ask the VBA to pick up that data and change the database query to match that date?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1