浏览表单,基于控件。 [英] Navigating through Forms, Based on controls.

查看:50
本文介绍了浏览表单,基于控件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试为我的数据库设置表单。我正确地设置了表结构和关系。我有两个表的问题:tblClientInformation和tblCompanyType。 tblClientInformation的表单允许您从5个选项(A-E)的下拉列表中选择公司类型,该选项链接到tblCompanyType。在输入此表单的基本信息后,人们会点击继续?按钮转到下一个表单。我在这里需要5种不同的形式。每个选择A-E为1。我需要继续按钮才能知道转到带有A-E相应信息的表格。 (A-E有不同的信息)。 1个客户端只能转到5个表单中的1个。因此,如果您从下拉列表中选择C,那么您将转到?C?进一步进入。在输入5个表格中的1个表格后,它们将继续,并且所有表格都以相同(新)形式结束。这个新表单将有一个后退按钮,它将允许与我尝试为继续按钮执行相同的操作。如果有人有任何建议我会很感激。我在Windows上的Access 2000中工作。

解决方案

只需在继续按钮单击事件中使用case select语句,就像这样


Private Sub Continue_Click()


选择Case Me.CompanyType


案例A

Docmd.openformFormA,,,,[ClientID] = me.ClientID"


案例B

Docmd.openform" FormA",,," [ClientID] = me.ClientID"


等...

结束选择


< blockquote>在B的情况下打开的表单。应阅读表格B。抱歉打字错误


你可以让Type ComboBox使用两列。一个用于操作员的显示和选择,另一个用于该类型所需的表单名称。当他们点击继续时,你打开ComboBox返回的表格。

后退按钮不那么简单。您需要将代码记住或继续访问原始选择。根据您的要求,有很多方法可以做到这一点。可能最简单的方法是在OpenArgs参数中将其从表单传递给表单。


Hi,

I am trying to set up the forms for my DB. I have the table structure and relationships set up properly. I have an issue with 2 of the tables: tblClientInformation and tblCompanyType. The form for tblClientInformation allows you to choose company type from a drop down list of 5 options (A-E) which is linked to tblCompanyType. After entering basic information on this form, people will click the ?continue? button to go to the next form. I need 5 different forms here. 1 for each of the selections A-E. I need the continue button to know to go to the form with the corresponding information for A-E. (A-E have different information). 1 client can only go to 1 of the 5 forms. So if you select C from the drop down, you go to form ?C? for further entry. After entering information on 1 of the 5 forms, they will continue on and all end up back at the same (new) form. This new form, will have a back button which will allow the same action as what I am trying to do for the continue button. If anyone has any suggestions I would appreciate it. I am working in Access 2000 on Windows.

解决方案

Just use a case select statement in the continue buttons click event, like this

Private Sub Continue_Click()

Select Case Me.CompanyType

Case "A"
Docmd.openform "FormA", , , "[ClientID] = me.ClientID"

Case "B"
Docmd.openform "FormA", , , "[ClientID] = me.ClientID"

etc...
End Select


the form opened in case "B" should read "Form B". sorry for the typo


You could have the Type ComboBox use two columns. One for the display and selection by the operator and another hidden one with the form name required for that type. When they click on Continue, you open the form returned by the ComboBox.
The Back button is less straightforward. You would need for the code to ''Remember'' or keep access to the original selection. There are a number of ways to do this depending on your requirements. Possibly the easiest is to pass it from form to form in the OpenArgs parameter.


这篇关于浏览表单,基于控件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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