Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query by Form (Access 2003)

    What I am trying to do is give my user a form to choose the criteria for the query, then build the SQL with code, then save the code as a QueryDef.

    I know I have done this before, but can not seem to remember the syntax.

    Can any one point me to an example or refresh my memory as to the syntax?


    Thanks for the help
    Richard

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query by Form (Access 2003)

    What features do you want to offer? Building a full-fledged query editor is a daunting task (and rather superfluous, since Access has one built in).

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    USA
    Posts
    386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query by Form (Access 2003)

    What I need to offer is a way to choose the criteria for the query. I will write the SQL for the SELECT and the FROM, it is just the WHERE that will vary.

    I think I founf the code I was looking for.


    Set MyQuery = db.CreateQueryDef(sQueryName, sSQL)


    Thanks for the help.
    Richard

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query by Form (Access 2003)

    Ah, I didn't realize you were only looking for the CreateQueryDef method. Sorry for the confusion.

Posting Permissions

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