我有一个包含几个子表单的表单。目前我有两个组合框。一个按供应商过滤子表单,另一个选择一个价格水平来确定哪个子表单,即价格水平,是可见的。我的那部分工作正常。但是,现在我还想根据价格水平选择显示一个消息框。
我有另一个包含特殊客户定价的表。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.
如果有两个客户:“客户名称”和“客户名称”有特价。
这是我的表关系
这是我当前的价格水平组合框代码
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
谢谢您的帮助。如果我没有意义,请告诉我,您需要更好的解释。