Results 1 to 3 of 3
  1. #1
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Need Query Help (2003)

    I'm a reasonably skilled Access person, but my query skills are pretty weak.

    Table1 contains contact information for about 1300 people. Its Handle field contains a unique identifier for each person.

    Table2 (actually an Excel worksheet right now, but I know how to Import it) contains the Handles of 220 people who are also in Table 1.

    I want to add a field to Table1 that has a text entry (maybe an "X") for each person whose Handle is in Table2. (So I can select these people when I need to.)

    It seems like an Update Query should be able to do this, but I don't know how to write it. Can anybody help?
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Need Query Help (2003)

    (Striclty speaking, you don't need a field in Table1, you can calculate the "x" dynamically in a select query.)

    I'd use a Yes/No field.

    - Open Table1 in design view.
    - Make sure that there is a unique index (preferably the primary key) on the Handle field.
    - Add a Yes/No field (or a text field of size 1 if you prefer)
    - Close and save the table.

    - Create a new query in design view.
    - Add Table1 and Table2 to the query.
    - Join the tables on the Handle field.
    - Add the field you just created in Table1 to the query grid.
    - Select Query | Update Query.
    - Enter True in the Update to line (or "x" if you created a text field)
    - Select Query | Run or click the ! button on the toolbar.

  3. #3
    5 Star Lounger Lou Sander's Avatar
    Join Date
    Jun 2002
    Location
    Pittsburgh, PA
    Posts
    855
    Thanks
    140
    Thanked 10 Times in 9 Posts

    Re: Need Query Help (2003)

    Got it!

    I know about YES/NO fields, but in the end Table1 will be exported to an Excel Worksheet. I'm just guessing, but I think the worksheet's users might be more comfortable with an "X" than a "TRUE" or whatever the exported file will show.
    Lou Sander
    Pittsburgh, Pennsylvania
    USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •