Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    40

    Unanswered: Variable Delcaration in Query?

    Is it possible to declare a variable in an Access query? If so, how?

    My dilemma: I have a form based on a parameter query. I want the value entered into the param query to be passed to some code in the form. So, what I am thinking is to declare the variable in the query (something like "[Enter record id:] = RID", where [Enter record id:] is the parameter value) so that RID is available to a function in the form).

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    You can use a function and call it in your Query

  3. #3
    Join Date
    Apr 2004
    Posts
    40
    Please forgive my ignorance, but how do you call a function from a query? What's the syntax, and where in the query do you place the call statement?

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    do it the other way - user inputs the "parameter" on the form. the query looks at the form for it's criteria.

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    To call a function from a query, suppose your function is called get_stichtag()
    then call it as it is shown in the photo
    Attached Thumbnails Attached Thumbnails FuncoQuery.jpg  

Posting Permissions

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