Updating on screen text fields with multiple table data


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Updating on screen text fields with multiple table data

Hybrid View

  1. #1
    William Ed Carden Guest

    Updating on screen text fields with multiple table data

    Hi,

    I have posted this query on other newsgroups with no response yet so
    I'm guessing this is a toughyu but here goes...

    VB6, ADO 2.1, Access97 database

    I have a Form with many text boxes set to fields in an ADO recordset.
    The recordset holds data from 2 tables. All the data from the 1st table
    is stored in the text boxes as it is except for one field which is
    stored in a DataComboBox and it holds the primary key to a record in
    the 2nd table. The SQL query returns a field from that second table
    based on the foreign key in table one matching the primary key in table
    2.

    SELECT T1.Field1, T1.Field2, T2.Fieldn From Table1 T1 Join Table2 T2
    Where T1.ForeignKeyField = T2.PrimaryKeyField

    A DataComboBox (DCB) control holds Table1's foreign key to Table2's
    Primary key. The row source of the DCB is SELECT Field1, Field2, FIELDn
    FROM Table. When I change the value of the DCB, the new value is stored
    in the recordset but 2 other fields on the form which hold values from
    Table2 are not updated. This situation is augmented more by the face
    that there is a 3rd table which is linked to Table2 that is also
    displayed on this form.

    To better explain... Lets say Table1 holds customer Names. Table2 holds
    their Category. And Table 3 holds the regions that each category
    belongs to. On the form the DCB displays the Name of the category but
    is bound to the recordset via Table1's ForeignKey field which points to
    Table2's PrimaryKey. One text box then holds the Catgeory description
    and another text box holds the Regions description. This all display
    properly except when I change the value of the DCb the other 2 text
    boxes are not updated until I close the form and re-load it which opens
    the recordset backup.

    I know this is a lot. The Requery method has provoked only errors.

    HELP!! PLEASE!!

    Ed


  2. #2
    Join Date
    Oct 2005
    Posts
    3
    Have you found a solution to this by any Chance? I am too looking for a similar solution. If you do have pls pass it on.

    Thanks,
    Clarify

  3. #3
    Join Date
    Oct 2005
    Location
    Rochester, NY
    Posts
    9
    Personally, I would not bind ANY controls to to a table or field. I have only run into problems doing this...

    it will take a bit more work.. but unbind them and control all the data yourself..
    you will have more control and wont run into problems like this
    Play BF2? Looking for a Clan? Come Join us!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center