having some fun and games with two cascading comboboxes on my form.
basically, after selecting a value in the 1st the second is updating but what I can only describe as th underlying value is not, and hence the subform which is displaying records (in theory) based upon the combobox values is inaccurate.
I'm also having problems with Null values which I have tried to offset by setting default values for the comboboxes.
Anyway, here's the offending code, and a copy of the latest database is attached.
Thanks, Lol
basically, after selecting a value in the 1st the second is updating but what I can only describe as th underlying value is not, and hence the subform which is displaying records (in theory) based upon the combobox values is inaccurate.
I'm also having problems with Null values which I have tried to offset by setting default values for the comboboxes.
Anyway, here's the offending code, and a copy of the latest database is attached.
Thanks, Lol
Code:
Private Sub cboCategory_AfterUpdate()
Me.cboProduct_Picker.Requery
Dim Category As String ' Tool Category to filter data to cboProduct_Picker
Dim Product As String ' Part number to filter records for subform
Me.cboCategory.SetFocus
Category = Me.cboCategory.Text
Me.cboProduct_Picker.SetFocus
Debug.Print Me.cboProduct_Picker.Column(0)
' Set source records for use to choose product based upon category selected in cboCategory
Me.cboProduct_Picker.RowSource = "Select Tbl_Product.ID_Product, Tbl_Product.Part_No, Tbl_Product.Details From Tbl_Product Where Tbl_Product.Tool_Category='" & Category & "';"
With Me.frm_Current_Location_Subform
If IsNull(Me.cboProduct_Picker) Then
.LinkChildFields = ""
.LinkMasterFields = ""
Else
.LinkChildFields = "ID_Product"
.LinkMasterFields = Me.cboProduct_Picker.Column(0)
End If
End With
End Sub