帮助组合框的形式 [英] Help With Combo box in form

查看:102
本文介绍了帮助组合框的形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在创建一个简单的Access数据库来保存Vehicle的所有服务记录。每辆车都有自己的桌子,共11个。所有表都具有相同的数据列,并且不需要彼此相关。我正在尝试制作一个用户友好的
FORM,我们可以每周输入一次(日期,小时,服务信息,替换的项目,下一个服务),每个表格都包含在这些表格中。我不想为每辆车制作11个不同的FORMS,我想制作一个带有下拉列表的表格,其中
用户可以选择车辆,然后可以输入5个不同的数据输入并链接到下拉列表中的相应表格。这可能吗?如何。 TIA。


Chris

解决方案

您好Chris,


您可以基于一个表创建表单,然后在表单中添加一个组合框。在组合框中列出所有车辆表的名称,并尝试使用下面的OnChange事件来更改表单的RecordSource。

 Private Sub cbxTableSelect_Change()
Me.RecordSource = cbxTableSelect.Value
End Sub

以下是演示。



最诚挚的问候,


Terry


Hello, I am creating a simple Access database to keep all of our service records for Vehicles. Each vehicle has its own table, 11 in total. All tables have the same data columns, and do not need to be related to one another. I am trying to make a user friendly FORM that once a week we can enter in (Date, Hours, Service Info, Items Replaced, Next Service) all of which each table has in them. Instead of having to make 11 different FORMS one for each vehicle, I would like to make ONE FORM with a drop down list where the user can pick the vehicle and then the 5 different data inputs can be entered and they link to the corresponding table in the drop down list. Is this possible? and How. TIA.

Chris

解决方案

Hi Chris,

You could create a form based on one table and then add a combo box in the Form. List all the vehicles tables' name in the combo box and try to use below OnChange event to change the RecordSource of the Form.

Private Sub cbxTableSelect_Change()
Me.RecordSource = cbxTableSelect.Value
End Sub

Here is the demonstrate.

Best Regards,

Terry


这篇关于帮助组合框的形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆