Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    48

    Question Unanswered: Binding 2 table fields together on a form

    Hi Folks,


    I have a Table which contains in one text field a Status Colour value (e.g. Green, Red, Amber), on the same table I have a corresponding field which contains URLs to .gif files that represent the status colour graphically.

    Can anyone tell me how to 'bind' the two fields in such a way that I can somehow select the Status colour value using a dropdown list on a seperate form, and automatically based on that value selected, assign the corresponding value on the URL field to a different image field on the form.

    If anyone can point me in the right direction, I'd be very grateful!!!

    Cheers,

    Luke

  2. #2
    Join Date
    Sep 2003
    Location
    T.O.
    Posts
    326
    I read your post a couple of times, but cannot determine how many forms (1 or 2) you are using.

    If you have a two column table with fields Colour and Path, and you have a combo box that has its RowSource based on this table, you can only bind one column (actually, you can only bind one column with a combo box anyway); however, you can use DLookup and fire it with the after update event of the combo box to look up your URL. If it's on a separate form, you will need to reference the forms collection first, then possibly the controls collection, then the control, then use DLookup.

    HTH.
    All code ADO/ADOX unless otherwise specified.
    Mike.

  3. #3
    Join Date
    Aug 2003
    Posts
    48
    Hi There!

    Thanks for your reply!

    I'm using one form to show records.

    This form draws it's information from a single table, which in turn uses smaller 'lookup' tables to supply data for some of it's fields.

    What I am (trying) to do is set the form up so that it can reference one field on the record (i.e. the Primary Key) and based on that info, show other fields from the same record on field in the form.

    In this case, by looking up the field in one of the Lookup tables that contains the 'Status Colour' information, I want to set up some code that automatically finds the corresponding URL to the image source stored on another field in the same table so if a field on the form says Green, the image displays the Green light.

    Does that make sense, or more importantly, sound like it could work?

    Cheers,

    Luke
    Last edited by Lukasx; 10-03-03 at 05:33.

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    not sure i understand what you are trying to do, but see if this takes you where you want to go.

    design-view your form
    add header/footer sections (if not already there)
    get all your fields of interest onto the detail section of the form (if not already there)
    switch the toolbox wizard on
    add a combo to the header of your form and tell the wizard
    o Find a record...

    izy

  5. #5
    Join Date
    Aug 2003
    Posts
    48
    Thanks!

    I'll give it a try!

Posting Permissions

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