Results 1 to 6 of 6
  1. #1
    zfnoch is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    2

    apply the same query criteria by different queries from the same access

    Hi,



    I am pretty new to access. Basically, I have several select queries that generate different results within the same access. One of the query criteria is "[enter current date]". When I run each of these queries, I have to enter the same date each time. so is it possible to run these queries with only entering date once?

    Thanks in advance

  2. #2
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Try having a form with a text box to enter the date.
    If you have a form named "Forn1", with a control named "tbCurrentDate", then in the query criteria row for the correct (date) column, you would have

    Forms!Form1,tbCurrentDate

    Be sure the form is open and a value (date) is entered in the control.

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You are doing this in the query directly? Should be using forms, not interacting with tables and queries. All/most of the criteria would come from form controls.
    One way is to reference the form and controls in the query (which will prompt you for those values if you open it directly). Another is to build a sql statement in code behind the form and then run that sql. Those queries should be supporting other forms or reports.

    EDIT - dang! Too late.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    @ Micron
    But you 'splained it much gooder..

  5. #5
    zfnoch is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    2
    Thank you all. Honestly, I never used form before. I am going to google the way to use form and see how it work.

  6. #6
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Post back if you get stuck........

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

Similar Threads

  1. Macro with 4 criteria, All or one can apply.
    By jeffhanner10@gmail.com in forum Macros
    Replies: 5
    Last Post: 11-11-2019, 09:51 PM
  2. Apply nested query criteria
    By Vbinet1 in forum Queries
    Replies: 1
    Last Post: 09-12-2017, 01:43 AM
  3. Selectively Apply Criteria
    By ztpkng in forum Queries
    Replies: 6
    Last Post: 06-24-2014, 11:10 AM
  4. Cross Apply queries in Acces?
    By SAugsburger in forum Queries
    Replies: 5
    Last Post: 04-14-2014, 10:23 AM
  5. Apply Filter 2 criteria not applying
    By ahightower in forum Forms
    Replies: 4
    Last Post: 07-28-2011, 03:31 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