Problem Synchronizing Combo Boxes (of a Form based on a table)

P

Phil

I’m brand new to Access and need wisdom from someone willing to
graciously assist. I also have almost Zero programming knowledge &
experience.

I’ve built a database that includes a form (PODetails), which requires
synchronized combo boxes. I designed a test form that is not based on
a table (as instructed by a Microsoft sample database) and managed to
synchronize 4 combo boxes. I have no Queries or Macros. The problem is
that when I try to synchronize combo boxes in my actual database,
specifically the ones in my “PODetails” form, it doesn’t work (VBA
code). When a user selects a Product Description, I want the “Supplier
Part Number”, “Inhouse Part Number”, and “Unit Price” combo boxesto
automatically fill based on the selected product description.

My (linked) tables include Suppliers, Customers, Parts, Purchase
Order, and PODetails. I’d like to know how I can get this to work
using VB or another method. Below is the code I used on the test
form.

Private Sub PartsID_AfterUpdate()
Me.SupplierPartNumber.RowSource = "SELECT SupplierPartNumber FROM" &
_
" PODetails WHERE PartsID = " & Me.PartsID
& _
" ORDER BY SupplierPartNumber"
Me.SupplierPartNumber = Me.SupplierPartNumber.ItemData(0)

Me.InhousePartNumber.RowSource = "SELECT InhousePartNumber FROM" & _
" PODetails WHERE PartsID = " & Me.PartsID
& _
" ORDER BY InhousePartNumber"
Me.InhousePartNumber = Me.InhousePartNumber.ItemData(0)

Me.UnitPrice.RowSource = "SELECT UnitPrice FROM" & _
" PODetails WHERE PartsID = " & Me.PartsID
& _
" ORDER BY UnitPrice"
Me.UnitPrice = Me.UnitPrice.ItemData(0)
End Sub
Thank you!
 
P

Phil

Allen Browne atwww.allenbrowne.comand Martin Greene atwww.fontstuff.com
both have excellent examples.
--
Milton Purdy
ACCESS
State of Arkansas










- Show quoted text -

Thank you for your assistance Milton. I will review their examples.

~Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top