Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    4

    Red face Unanswered: Syntax for passing parameters in Access

    I need to pass parameters from form elements to a query. What is the general syntax for this?

    Thanks so much for your assistance!:

  2. #2
    Join Date
    May 2009
    Posts
    258

  3. #3
    Join Date
    Aug 2009
    Posts
    4
    This document is for passing parameters from Access to an outside app. I just want to simply take three values (one text value from a combo box, two DATE values from a Calendar control) associated with the Access form controls and have a Query in Access CALL these three values for Criteria filters. There's a button on the form to run the Query. So, something like this in the Criteria of the Query:

    [Forms!]![Switchboard]![cmbOrg]![Value]

    The DATES from the Calendar control are trickier because of the syntax of the criteria. I thought this would work (but didn't):

    Between [Forms!]![Switchboard]![StartCalendar] AND [Forms!]![Switchboard]![EndCalendar]

    Guess I'm not sure whether I should assign a variable for the form control values (selected Combo box value, Calendar Start Date, and Calendar End Date), or can I simply enter criteria in the query to call the object values without specifying variable in the form with VBA. I've tried both without success - probably just bad syntax.

  4. #4
    Join Date
    May 2009
    Posts
    258
    Not necessarily outside of Access only, but not the approach you wanted.

    Here's an example that uses form values in query parameters:
    Microsoft Access Query Parameters Example

Posting Permissions

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