我的任务是在msaccess2007中设计一个临时客户跟踪系统(sheeeesh!)。表和关系都已成功设置。但是我在为一个表设计数据输入窗体时遇到了一个小问题。。。先给你解释一下。
屏幕包含3个下拉框(除其他字段外)。
第一个下拉列表
第一个下拉列表
(CBO市场)
表示
市场
因为第一个下拉列表只包含2个项目,所以我没有为它制作表格。我将它们添加为预定义的列表项。
一旦用户在其中做出选择,第二个下拉列表
(CBOLEAD类别)
绑定表的结构,名为
第二个组合是:
ID Autonumber
Lead_Type TEXT <- actually a list that takes up Domestic or International
Lead_Category_Name TEXT
第3个下拉列表
(CBoledSource)
应该显示属于特定类别的一组预定义的铅源。
表名为
铅源
ID Autonumber
Lead_Category NUMBER <- related to ID of Lead Categories table
Lead_Source TEXT
当我在第一个下拉列表中进行选择时
更新后
调用组合的事件,指示第二个下拉列表加载内容:
Private Sub cboMarket_AfterUpdate()
Me![cboLead_Category].Requery
End Sub
行源
第二个组合的包含一个查询:
SELECT Lead_Categories.ID, Lead_Categories.Lead_Category_Name
FROM Lead_Categories
WHERE Lead_Categories.Lead_Type=[cboMarket]
ORDER BY Lead_Categories.Lead_Category_Name;
Private Sub cboLeadCategory_AfterUpdate()
Me![cboLeadSource].Requery
End Sub
SELECT Leads_Sources.ID, Leads_Sources.Lead_Source
FROM Leads_Sources
WHERE [Lead_Sources].[Lead_Category]=[Lead_Categories].[ID]
ORDER BY Leads_Sources.Lead_Source;
当我从cboMarket中选择Market type时,第二个组合cboLeadCategory会毫不费力地加载相应的类别。
但是,当我从中选择一个特定的类别时,会显示一个模式对话框,要求我
输入参数
.
alt text http://img163.imageshack.us/img163/184/enterparamprompt.png
alt text http://img52.imageshack.us/img52/8065/enterparamprompt2.png
为什么会这样?为什么第三个框没有按需要加载源名称。有谁能告诉我哪里出了问题吗?
谢谢,
===================================================
更新
SELECT Leads_Sources.ID, Leads_Sources.Lead_Source
FROM Leads_Sources
WHERE (((Leads_Sources.Lead_Category)=[cboLead_Category]))
ORDER BY Leads_Sources.Lead_Source;