Results 1 to 2 of 2

Thread: Getting "relationships" using VB code

  1. #1

    Thread Starter
    Addicted Member Geoff Gunson's Avatar
    Join Date
    Jun 1999
    Posts
    241

    Post

    Hi

    I have an access database with 2 tables.

    Table 1 contains a field that gets all its possible values from table 2. So within access if i click on that field a combo box appears with all the options that i can select.

    What I want to know is if it is possible to retrive this relationship when I open the database within VB code.

    I have tried : CDRrs.Fields(FieldIndex).SourceTable

    where CDRs is the open recordset but all it returns is the name of the table that the field is in. I would like to know the name of the table with all the values in.

    Your is greatly appreciated.

    Cheers
    Geoff

  2. #2
    Lively Member
    Join Date
    Jan 1999
    Location
    Gloucester, UK
    Posts
    78

    Post

    Sounds to me like you need to fire another query...

    So on the combo1_click event, you might want to do a query with a similar SQL statement to : -

    "SELECT values FROM table2 WHERE linkID = " & combo1

    And then populate whatever it is you are populating using the resulting recordset.

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