Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2002
    Posts
    2

    Talking Unanswered: Need Help with access and VB

    I have an access database with two tables. Table A and Table B. My VB program connects to the database through ADO. I have 2 forms. Form A accesses table A and Form B accesses Table B. Form A has recordset A and form B has recordset B. The database itself has a child/parent relationship. Both of my forms are normal forms, not MDI. I can update access through the FormA, but when I try it through form B I get an error> It wont let me update the table because it has a field that is required in table A.

    What am I doing wrong?

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    What error are you receiving ? What is the sql statement that it is failing on ?

  3. #3
    Join Date
    Mar 2003
    Location
    Belgium
    Posts
    3
    Maybe you should just give some extra code that says that every time you update B that A als is being updated automatically

  4. #4
    Join Date
    Mar 2003
    Posts
    7

    Re: Need Help with access and VB

    Originally posted by Alan
    I have an access database with two tables. Table A and Table B. My VB program connects to the database through ADO. I have 2 forms. Form A accesses table A and Form B accesses Table B. Form A has recordset A and form B has recordset B. The database itself has a child/parent relationship. Both of my forms are normal forms, not MDI. I can update access through the FormA, but when I try it through form B I get an error> It wont let me update the table because it has a field that is required in table A.

    What am I doing wrong?
    Hi there,

    as I understand it table A is the parent. That's why you can update this.
    Table b is thus the child so it needs to have a relation ship to table a.
    EG:
    table A
    IDA
    nameA

    Table B
    IDA
    IDB
    NameB

    [table A].IDA = [table B].IDA.

    So in you're form you would need the fields:
    IDA, IDB and NameB.

    so you would get something like:
    UPDATE TABLE B
    SET Nameb = strNameB, IDB = i
    WHERE tableB.IDA = tableA.IDA

    HTH

    VS

Posting Permissions

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