What I am hoping to do is this, I would like the user to be able to select a record within this subform and a 2nd subform populates with a date and prices for that particular product.
The data is coming from 3 tables:
Supplier Details
Product Details
Product Prices (over time)
The first part of my attempt is fine, I can get the 1st subform to narrow down by supplier name ok. Yet I can't figure out for the life of me how I can get from clicking between records in the subform to populating the 2nd subform on the sheet. Things like AfterUpdate, SelectionChange etc don't appear to be doing anything.
In case it helps, here is the code that is populating the first subform:
Expand|Select|Wrap|Line Numbers
- Option Compare Database
- Private Sub Form_Open(Cancel As Integer)
- ' Call subroutine to set filter based on selected Supplier Name
- SetFilter
- End Sub
- Sub SetFilter()
- Dim LSQL As String
- Me.Refresh
- LSQL = "SELECT * FROM SupplierDetails"
- LSQL = LSQL & " WHERE SupplierDetails.SupplierName = '" & Combo87 & "'"
- ' Debug.Print LSQL
- Form_Maintain_SuppDet.RecordSource = LSQL
- End Sub
- Private Sub Combo87_AfterUpdate()
- ' Call subroutine to set filter based on selected Supplier
- SetFilter
- End Sub