Query A Table Using A Value From A Form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aric Green
    New Member
    • Jan 2008
    • 23

    #1

    Query A Table Using A Value From A Form

    I have a form that contains customer information. I want to use the ID_NUMBER to query another table (when I click a button) to return the record that matches that ID_NUMBER. What is the easiest way to do this?
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    1. Create a Query based on your Customer Table.
    2. In the Criteria Row for the ID_NUMBER, set Criteria similar to the following:
      Code:
      [Forms]![<Your Form Name>]![<Field contained ID_NUMBER>]

    Comment

    • Aric Green
      New Member
      • Jan 2008
      • 23

      #3
      Thanks ADezii. That is what I was thinking but it was not working. I figured it out though. I was creating a new record on the form and using the query to append the ID NUMBER to other tables to create a record automatically on them to use later. I wasn't requerying the form and going back to the record before running the append querys so it was not creating the new record in the other tables. Now that I have figured this out I just have to write the code to do that. Again thanks.

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Originally posted by Aric Green
        Thanks ADezii. That is what I was thinking but it was not working. I figured it out though. I was creating a new record on the form and using the query to append the ID NUMBER to other tables to create a record automatically on them to use later. I wasn't requerying the form and going back to the record before running the append querys so it was not creating the new record in the other tables. Now that I have figured this out I just have to write the code to do that. Again thanks.
        You are quite welcome, Aric.

        Comment

        Working...