Results 1 to 2 of 2
  1. #1
    bs0d is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2014
    Posts
    32

    Fixed Parameter Value in SQL Statement

    In Access, can I hard code a parameter value to suppress the prompt? I'm querying a query that's made up of sub queries, which all require the same parameter.

    I'd like to define the parameter value in my SQL statement so there is no prompt. Can this be done directly in my Access query?

    Again, the parameter isn't any part of my main query, it's part of the sub-queries that make up the master query if that makes any sense.


    Thanks,

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Yes, parameter can be static, like:

    SELECT * FROM table WHERE Status="Current";

    Or for dynamic parameter and no popup, the parameter references a control on a form, like:

    SELECT * FROM table WHERE Status=Forms!formname!cbxStatus;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 03-12-2015, 05:55 PM
  2. Replies: 3
    Last Post: 10-23-2014, 04:22 PM
  3. How do I use a passed parameter in a Case statement
    By tarenja in forum Programming
    Replies: 7
    Last Post: 08-04-2013, 10:49 PM
  4. Replies: 2
    Last Post: 04-04-2013, 03:13 PM
  5. Use Parameter in select statement (Sql in Access)
    By mohammadyou in forum Access
    Replies: 6
    Last Post: 06-04-2012, 01:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums