I have a form with several subforms. Currently I have two combo boxes. One that filters out the subforms by supplier, and the other selects a price level which determines which subform, price level, is visible. I have that part working fine. However, now I also want to display a message box based on the price level selection.
I have another table that contains special customer pricing. Is it possible for example, when the combo box price level is selected it checks to see if there are customers at that price level with special pricing and display a message box with the customers who have special pricing.
If there are two customers: "Customer Name" and "Customer Name" have special pricing.
Here is my table relations
Here is my current code for the price level combo box
Option Compare Database
Sub ShowSubform()
'Save unsaved changes to currently open subform
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'Display appropriate subform based on cboPriceLevel chosen
If cboPriceLevel = "J6" Then
J6_All_subform.Visible = True
J7_All_subform.Visible = False
J8_All_subform.Visible = False
ElseIf cboPriceLevel = "J7" Then
J6_All_subform.Visible = False
J7_All_subform.Visible = True
J8_All_subform.Visible = False
Else
J6_All_subform.Visible = False
J7_All_subform.Visible = False
J8_All_subform.Visible = True
End If
End Sub
Private Sub Form_Current()
'Call subroutine to display appropriate subform based on template type
ShowSubform
End Sub
Private Sub cboPriceLevel_AfterUpdate()
'Call subroutine to display appropriate subform based on template type
ShowSubform
End Sub
Thanks for the help. Let me know if I don't make sense and you need a better explanation.