Results 1 to 2 of 2
  1. #1
    hfreedman1957 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2017
    Posts
    35

    User Input value to use as criteria for multiple fields


    Hi,
    When I run a particular query, I want the user to be prompted for a value, and then use that value as criteria in multiple fields in the query. I tried declaring a global temporary variable, then added that tempvar as a field in the query prompting the user for input in the criteria. I then used that temporary variable as criteria for the other fields. Running this query displayed no results. Please help.

  2. #2
    hfreedman1957 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2017
    Posts
    35
    I just figured out a solution. I create a macro that first set the temporary variable via ImputBox and then ran the query (without inputting the tmpvar). It works fine. Is there a more efficient way to do this all inside the query without using a macro? Thanks!

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

Similar Threads

  1. Criteria based on user input
    By vincentsp in forum Queries
    Replies: 4
    Last Post: 03-25-2015, 10:46 AM
  2. Criteria based on user input
    By Alsail77 in forum Queries
    Replies: 5
    Last Post: 08-16-2012, 02:19 PM
  3. Selecting records based on criteria from user input
    By shabbaranks in forum Programming
    Replies: 1
    Last Post: 01-04-2012, 09:06 AM
  4. Criteria issue when using user input and > < ect
    By scotty562 in forum Queries
    Replies: 3
    Last Post: 11-11-2010, 11:08 AM
  5. Replies: 6
    Last Post: 07-22-2010, 05:53 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