Solved

How do I reference another table's field value in MS Access query?

Posted on 2016-08-24
5
36 Views
Last Modified: 2016-08-25
Dear Experts!

Please see attached file. What is the proper syntax for referencing a field from a different table in my query? The query works great when I type a date in manually but when I reference a field it does not.

Thanks!
screenshots.pdf
0
Comment
Question by:shogun5
  • 3
  • 2
5 Comments
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
ID: 41768716
You can only reference tables that are included in the query.  You can drag this table onto the QBE and draw a join line between the two dates.  Remove the criteria because the join will serve that purpose.  Then put the query into SQL view and change this join's relational operator from "=" to ">=".  Once you change to a non-equi join, you won't be able to return to QBE view since the editor can only display equi-joins graphically.

Another way to enter criteria is to use a form to run the query/report/form.  The query would reference the form.

Where SomeField = Forms!someform!somefield
0
 

Author Closing Comment

by:shogun5
ID: 41769480
Pat,

Worked like a charm! Thanks!
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 41769482
Great.  Which method did you use?
0
 

Author Comment

by:shogun5
ID: 41770139
I just changed the sign in SQL it was easy enough.
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 41770599
Thanks.  It is always good to clarify which solution worked for you when more than one is offered.  That helps people who find the thread later.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now