English 中文(简体)
进入表格中通过数值
原标题:Passing values in Access Forms

我在Microsoft Access数据库中有两个表格和一个表格。 让我们看一看 t,再看第二张 t。 tblCUSTOMERS包括称为客户信息(主要关键)、第一Name和最后一Name的田地。 tblINVOICES包括称为InvoiceID(主要钥匙)、客户信息(外国钥匙)和数量。 表格称为“热电”,包含 t网照电站领域的文本箱。

我要做的是创造功能,使我能够通过我的客户桌旁搜寻,从桌上挑选客户记录,然后将记录上的客户数据库退回到假票。 理想的情况是,查询方式将像一个数据网一样,能够由第一Name、最后一个Name和客户信息数据库查询。

Specifically can you advise me of the simplest way to: 1. Insert a form (lets call this new form frmCUSTOMERS) with something like a datagrid control to show customer records. 2. Update the datagrid on frmCUSTOMERS to display only records matching a query of tblCUSTOMER (such as only customers where firstname starts with B ) 3. Pass the CustomerID from frmCUSTOMERS to frmINVOICES.

许多感谢,

Brett

最佳回答

你在开张时可以把开张作为开张的理由。

DoCmd.OpenForm "frmFormName", , , , , ,"B"

或可在标准说明中通过:

DoCmd.OpenForm "frmFormName", , , "FirstName LIKE  B* "

如果你走第一条路,你会这样做:

Private Sub Form_Load()
    Me.Filter = "FirstName LIKE  " & Nz(Me.OpenArgs, "") & "* "
     or
    Me.Subform1.Form.Filter = "FirstName LIKE  " & Nz(Me.OpenArgs, "") & "* "
End Sub

为使客户信息数据库等价值从搜索表中收回,有许多选择。 你们可以把价值放在全球变量中。 或者,通过使用电话形式的公共可变功能或公共功能,你可以采用搜索表对打字形式给予回报。

或许,采取更正确和更清洁的方式,就是设计一个处理开放搜索表格和通过有限制和不受约束的价值观的班级。 班级确实需要更多的知识和技能来书写,对你试图做的事情来说,这很可能是过分的。 当然不需要一个班子来做这项工作。 这样做只会比较清洁。 在现实中,如果你确实为此写了一门课,你将使用上述许多相同技术。

问题回答

暂无回答




相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签