By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,695 Members | 1,638 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,695 IT Pros & Developers. It's quick & easy.

How to update related fields in two tables by one combo

P: 16
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;

Expand|Select|Wrap|Line Numbers
  1. Private Sub Supplier_AfterUpdate()
  2. Dim dbs As Qualityfoam.Database
  3. Dim rsSuppliers As Qualityfoam.Recordset
  4.  On Error GoTo ErrorStuff
  5. Set dbs = CurrentDb
  6. Set rsProducts = dbs.OpenRecordset("tblsuppliers", dbOpenDynaset, dbSeeChanges)
  7. rsSuppliers.AddNew
  8. rsSuppliers![supplier ID] = Me!newsupplierid
  9. rsSuppliers![supplier name] = Me!newsuppliername
  10. rsSuppliers![other stuff as needed] = Me!othernewstuff
  11. rsSuppliers.Update
  12.  
  13. rsSuppliers.Close
  14. Set rsSuppliers = Nothing
  15. Set dbs = Nothing
  16.  
  17. Exit Sub
  18.  
  19. ErrorStuff: Resume Next 
  20.  
kindly help me jim or any other expert.
Jun 25 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.