Results 1 to 2 of 2

Thread: Finding values in 2 tables?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    103

    Unhappy Finding values in 2 tables?

    Okay, I've got 2 tables:

    Table A
    CLASS TEMP_RANGE_MIN TEMP_RANGE_MAX
    1 0 20
    2 21 40
    3 41 60


    Table B
    ITEM TEMP CLASS
    Cow 18
    Cat 30
    Keyboard 55
    Dog 21

    -Both tables exist in the same Access97 database

    In Table B, the user inputs ITEM and TEMP but not CLASS... When another button is clicked, the program has to refer to Table A and write the CLASS that each item belongs to in Table B.

    Is this possible? How do I do this? Would really appreciate some assistance before I self-combust!

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    You can open a recordset to Table A. When the user clicks that other button you can run code to find out where the Temp fits, and retrieve the corresponding class value from the recordset.

    Alternatively once the user clicks the button, you can run an SQL query that picks up only the suitable record from Table A based on the TEMP value, and returns its Class in a recordset. Use it in Table B.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

Posting Permissions

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



Click Here to Expand Forum to Full Width