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!
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!