作者:黄承念63772 | 来源:互联网 | 2023-05-19 18:42
IhaveanapplicationinAccess2003thatIamworkingon.Init,Ihaveanemployeetable,whichis
I have an application in Access 2003 that I am working on. In it, I have an employee table, which is connected to two other tables. The two connected tables are tables that hold a few fixed KeyWords. In my main employee table, I just have the ID from the other table, rather than having the whole word.
我正在使用Access 2003中的应用程序。在其中,我有一个employee表,它连接到另外两个表。两个连接的表是包含一些固定KeyWords的表。在我的主员工表中,我只是拥有来自另一个表的ID,而不是整个单词。
I wanted to make a form for entering data into these tables, so I made a query from the three tables that shows the all the regular fields of the employee table except instead of those two ID's, I showed the words themselves.
我想创建一个表格,将数据输入这些表格,所以我从三个表格中查询了员工表格的所有常规字段,除了这两个ID之外,我自己展示了这些单词。
I then made the form and set the query as the RecordSource. The fields that have keywords are Combo boxes on my form, and their ControlSource is the keyword field from the query (like I mentioned earlier, the value can only be one keyword out of a list). Now, the problem I face is this: When I want to see a single record, it shows the correct value in the ComboBox, but when dropdown the menu, it doesnt show any of the other values.
然后我创建了表单并将查询设置为RecordSource。具有关键字的字段是我表单上的组合框,它们的ControlSource是查询中的关键字字段(就像我之前提到的,值只能是列表中的一个关键字)。现在,我面临的问题是:当我想要查看单个记录时,它会在ComboBox中显示正确的值,但是当下拉菜单时,它不会显示任何其他值。
What is the best way to do this? Am I doing this in the wrong way?
做这个的最好方式是什么?我这样做是错误的吗?
Thank you
3 个解决方案
0
ControlSource is the column name of the table where any user entry will be saved.
ControlSource是将保存任何用户条目的表的列名。
RowSource is where you type the name of the saved query or manual query typed directly into that field, which is used to provide a list of available drop down options for the combo box.
您可以在RowSource中键入直接键入该字段的已保存查询或手动查询的名称,该字段用于提供组合框的可用下拉选项列表。
RowSourceType should be set to Table/Query, which is based on aforementioned RowSource method.
RowSourceType应设置为Table / Query,它基于前面提到的RowSource方法。
Now to correct the problem of only displaying what you begin to type (i.e. "Allow AutoCorrect" in Property Sheet > Other) or already have saved for that record without other options appearing after clicking the drop down is the following:
现在,要解决仅显示您开始键入的内容(即“属性表”>“其他”中的“允许自动更正”)或已经为该记录保存的问题,而在单击下拉列表后没有显示其他选项的情况如下:
- In Design View, click the combobox in question.
在“设计视图”中,单击相关的组合框。
- Property Sheet > Format > Column Count = set the desired number of columns to display in drop down.
属性表>格式>列计数=设置要在下拉列表中显示的所需列数。
- Property Sheet > Format > Column Widths = set the desired width of column in the drop down.
属性表>格式>列宽度=在下拉列表中设置所需的列宽。
- Property Sheet > Format > List Width = set the desired width of the drop down itself.
属性表>格式>列表宽度=设置下拉本身的所需宽度。
- Property Sheet > Data > Bound Column = set to the column of query table (i.e. 1 for ID and 2 for list options, if you only have two entries)
属性表>数据>绑定列=设置为查询表的列(例如,1表示ID,2表示列表选项,如果您只有两个条目)
Note: If your desired drop down options are column two and not column one (makes things easier btw) then do the following change from above:
注意:如果您需要的下拉选项是第二列而不是第一列(使事情变得更简单),请从上面进行以下更改:
- Property Sheet > Format > Column Count = set the desired number of columns to two.
属性表>格式>列计数=将所需的列数设置为2。
- Property Sheet > Format > Column Widths = add two entries 0",1" which means the ID field is not visible (0") and the options field is one-inch.
属性表>格式>列宽度=添加两个条目0“,1”表示ID字段不可见(0“),选项字段为1英寸。
The easiest way to sort this out in the beginning is to view the column header names to know what you are looking at in the meantime by doing the following: Property Sheet > Format > Column Heads = set to yes. At least you will know what is showing and whether or not you are on the right track.
在开头对此进行排序的最简单方法是通过执行以下操作来查看列标题名称以了解您正在查看的内容:属性表>格式>列标题=设置为是。至少你会知道什么是显示以及你是否在正确的轨道上。