【问题标题】:Assistance with combo box using lookup table - MS Access使用查找表协助组合框 - MS Access
【发布时间】:2012-07-12 12:00:14
【问题描述】:

基本上我拥有的是一个Customer 表,其中包含有关我们客户的信息。此表中的字段之一是Customer.CustomerTypeID
我还有一个CustomerType 表,它基本上是一个查找表。
我希望CustomerType.CustomerTypeName 字段填充我的组合框,然后当我去保存我的记录时,我希望CustomerType.CustomerTypeNameCustomerType.CustomerTypeID 我选择在Customer.CustomerTypeID 字段中进行更新。

我是否过于复杂了?我是否应该更改它以便将CustomerName 存储在Customer 表中而不是ID?

提前致谢。

【问题讨论】:

    标签: ms-access combobox lookup-tables


    【解决方案1】:

    不,存储 ID。

    像这样设置你的组合:

    Row Source: SELECT CustomerTypeID, CustomerTypeName FROM CustomerType 
    Control Source : CustomerTypeID
    Bound Column : 1
    Column Count : 2
    Column widthes : 0, 2
    

    控件源+绑定列表示数据将存储到表单所基于的表中名为CustomerTypeID的字段中,列宽表示隐藏ID列并显示描述。

    【讨论】:

      猜你喜欢
      • 2013-10-26
      • 2017-03-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-04
      • 2013-05-17
      相关资源
      最近更新 更多