Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9040219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:55:56+00:00 2026-06-16T09:55:56+00:00

Here is the scenario. I have a database that is single function basically to

  • 0

Here is the scenario. I have a database that is single function basically to manage documents. There are two tables that I am dealing with for this example.

Table 1: Table of Documents with the following fields DOCUMENT_NUM, PK; DOCUMENT_NAME; etc. One-to-many relationship to Table 1 with referential integrity based on DOCUMENT_NUM

Table 2: Table of revision history of documents with fields DOCUMENT_NUM, PK; REVISION_DATE; REVISION_NUM.

I have a form that enters in the information for Table 1, and another form that enters in information into Table 2 pulling in DOCUMENT_NUM off the criteria in Form 1.

My problem: I have a search form that I want to be able to open Form 1 that is bound to Table 1 by searching for not only parameters that are in Table 1 but also in Table 2. Example: Search for documents revised between ##/##/#### and ##/##/#### but will open Form 1 with the “DOCUMENT_NUM”, “DOCUMENT_NAME”, etc. However I cannot do the search since From 1 is bound to Table 1 and the information I am querying against is in Table 2.

The Search uses DoCmd.OpenForm "Documents",,,strQuery where strQuery = "1=1 AND [SOPS].[SOP_NUMBER] = 'QA-001' AND [SOP_REVISIONS].[REVISION_DATE] >= #12/02/2011# AND [SOP_REVISIONS].[REVISION_DATE] <= #12/02/2012#"

([SOPS] == Table 1 && [SOP_REVISIONS] == Table 2)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T09:55:57+00:00Added an answer on June 16, 2026 at 9:55 am

    How about:

    strQuery = "1=1 AND [SOPS].[SOP_NUMBER] = 'QA-001' " _
        & "AND DOCUMENT_NUM IN (" _
        & "   SELECT DOCUMENT_NUM FROM [SOP_REVISIONS] " _
        & "   WHERE [SOP_REVISIONS].[REVISION_DATE] >= #12/02/2011# " _
        & "   AND [SOP_REVISIONS].[REVISION_DATE] <= #12/02/2012#)"
    

    In other words, use a subquery to get the related DOCUMENT_NUM from [SOP_REVISIONS].

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my scenario: I have two MySQL tables: Categories (columns: id, category) Items
Here's the scenario: You have two seperate websites that exist in different environments (I.E.
Ok here's the scenario: we have 1 database that has a table we'd like
Here is the scenario: I have a visual that displays some data The data
Here's the scenario: I have 2 tables with data, one is the 2009 version
Here's the scenario: I have a private site that, once logged on, will display
Here's the scenario: I have 2 tables: CREATE TABLE dbo.API_User ( id int NOT
Here is the scenario: I have an object called a Transaction that needs to
Here is my scenario: I have a document, currently a FlowDocument, that I would
Here is the scenario: I have a table that records the user_id, the module_id,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.