MS-Access中的查询设计帮助 [英] Help with Query design in MS-Access

查看:144
本文介绍了MS-Access中的查询设计帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CredTypeID是一个数字,CredType是凭据的类型

CredTypeID is a number the CredType is the type of Credential

我需要查询以在下拉列表中显示凭据,以便可以通过选择一个新凭据来更改凭据.

I need the query to display the Credential in a drop down list so I can change the credential by selecting a new one.

当前,我必须知道CredTypeID编号才能更改凭据.

Currently I have to know the CredTypeID number to change the Credential.

我只想从下拉列表中选择它.

I just want to select it from a drop down list.

当前要将Betty Smith更改为RN,我必须在CredTypeID中键入"3".我只希望能够从下拉列表中选择"RN".

Currently to change Betty Smith to an RN I have to type "3" in the CredTypeID. I just want to be able to select "RN" from a drop down list.

这是表布局和sql视图(来自访问权限)

Here is the table layout and sql view (from access)

SELECT Lawson_Employees.LawsonID, Lawson_Employees.LastName, 
       Lawson_Employees.FirstName, Lawson_DeptInfo.DisplayName, 
       Lawson_Employees.CredTypeID, tblCredTypes.CredType 
  FROM (Lawson_Employees 
       INNER JOIN Lawson_DeptInfo 
          ON Lawson_Employees.AccCode = Lawson_DeptInfo.AccCode) 
       INNER JOIN tblCredTypes 
          ON Lawson_Employees.CredTypeID = tblCredTypes.CredTypeID;

推荐答案

这应该可以解决问题,它将在数据表视图中工作,并且如果您将字段添加到任何新字段中,则可以将该字段自动设置为所需的下拉列表类型表格.

This should do the trick, will work in datasheet view and auto-set up the field as the type of dropdown you want if you add the field to any new forms.

  1. 在以下位置打开Lawson_Employees表 设计视图.
  2. 单击CredType字段,然后在 屏幕底部切换到 查找"标签
  3. 将DisplayControl更改为组合框
  4. 将行源更改为 以下查询:

  1. Open the Lawson_Employees table in design view.
  2. Click on the CredType field and at the bottom of the screen switch to the "lookup" tab
  3. Change DisplayControl to "Combobox
  4. Change the Rowsource to be the following query:

从tblCredTypes中按CREDTYPE ASC顺序选择CREDTYPEID,CREDTYPE

设置columncount = 2

Set columncount=2

如果您已经将Lawson_Employees.CredTypeID字段添加到表单中,请将其删除,然后重新添加以使其自动设置,以便您可以通过友好标签而不是id进行选择.

If you have already added the Lawson_Employees.CredTypeID field to a form, delete it and then re-add it to get it to automatically set it up so you can select by the friendly label instead of the id.

这篇关于MS-Access中的查询设计帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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