How to update related fields in two tables by one combo

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gerryis2000
    New Member
    • Jun 2010
    • 16

    How to update related fields in two tables by one combo

    Thanks again jim, sorry to bother you. i,m working on this data base now so lets try it here.the data base name is 'qualityfoam' the two tables i,m working with from the database are [proforma invoices] and [suppliers] so some users want to update invoice details before adding a supplier name. the field shared between the two tables is [supplier name]. i have tried the code you gave me but got error. the following is what i typed in the code section;

    Code:
    Private Sub Supplier_AfterUpdate()
    Dim dbs As Qualityfoam.Database
    Dim rsSuppliers As Qualityfoam.Recordset
     On Error GoTo ErrorStuff
    Set dbs = CurrentDb
    Set rsProducts = dbs.OpenRecordset("tblsuppliers", dbOpenDynaset, dbSeeChanges)
    rsSuppliers.AddNew
    rsSuppliers![supplier ID] = Me!newsupplierid
    rsSuppliers![supplier name] = Me!newsuppliername
    rsSuppliers![other stuff as needed] = Me!othernewstuff
    rsSuppliers.Update
      
    rsSuppliers.Close
    Set rsSuppliers = Nothing
    Set dbs = Nothing
      
    Exit Sub
      
    ErrorStuff: Resume Next
    kindly help me jim or any other expert.
    Last edited by Niheel; Jun 25 '10, 03:53 PM. Reason: please use code tags to display code
Working...