问题描述
大家好!
这个论坛对像我这样的Access初学者非常有用。我相信我的问题只能在这个论坛上解决。
我有两个表(tblCustomers和tblOrders)和一个表格(frmOrders)用于数据输入,tblCustomers有以下字段:
CoID(自动编号)
客户ID(文字,PK)
CustomerFullName(文字)
tblOrders具有以下内容字段:
OrderID(自动编号,PK)
CustomerID(来自tblCustomers.CustomerID的查找文本)
产品(文字)
数量(文本)
价格(货币)
我将frmOrders设置为一个组合框,其中RowSource = SELECT [tblCustomers]。[CustomerID ] FROM tblCustomers WHERE tblCustomers.CoID = Forms!frmOrders!OrderID;
和[frmOders]的AfterUpdate事件![OrderID]设置为
私有子订单ID_AfterUpdate()
CustomerID.SetFocus
Me.CustomerID.Selected(0)= True
End Sub
intesion是保持Combobox的第一个值显示而不手动选择它。但是它保持其价值等待选择。
我在哪里做错了?
请帮忙!
Hi all!
This forum has been very usefully for the Access Beginners like me. I believe my problem can only be solved in this forum.
I have two tables (tblCustomers and tblOrders)and one form (frmOrders)for data entry, tblCustomers has the following fields:
CoID (Autonumber)
CustomerID (Text,PK)
CustomerFullName(Text)
The tblOrders has the following fields:
OrderID (Autonumber, PK)
CustomerID (Lookup Text from tblCustomers.CustomerID)
Product (Text)
Quantity (Text)
Price (Currency)
I set a frmOrders to be a combobox of which RowSource=SELECT [tblCustomers].[CustomerID] FROM tblCustomers WHERE tblCustomers.CoID=Forms!frmOrders!OrderID;
and the AfterUpdate event of [frmOders]![OrderID] set to
Private Sub OrderID_AfterUpdate()
CustomerID.SetFocus
Me.CustomerID.Selected(0) = True
End Sub
The intesion is to keep the first value of Combobox to showup without manually select it. But instead it keep its value waiting for selection.
Where did I do wrong on this?
Please help!
推荐答案
这篇关于如何将Combobox设置为默认显示其第一个值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!