加载具有特定记录的表单 [英] Load form with specific record

查看:53
本文介绍了加载具有特定记录的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 -

我现在一直在努力解决这个问题,差不多2个星期,并且无法解决这个问题。


我有一个用户创建采购订单(tblPOData)。在一些

的情况下,这个或另一个用户必须创建一个发票,以便与PO一起使用

(我知道 - 这没有任何意义,但这是业务
case)。


我让用户去表单创建发票:

frmCreateSpInvoice。

用户从下拉列表中选择PO。然后,用户从另一个下拉列表中选择

供应商位置。


每个下拉列表中的字段填充表单上的信息字段

用户可以看到他们正在使用正确的PO。 (字段

类似PO上的美元金额[来自PO数据表],城市和州

供应商,供应商联系人[来自供应商表])。


然后用户输入必要的信息并打印发票。


frmCreateSpInvoice基于一张只保留发票的表
$ b这个供应商的$ b数据(tblSpInvoiceData)(POKey,VendorLocationKey,

PickUpDate等)。


我想:


1.如果发票记录 - POKey是唯一的 - 不存在,请允许用户选择供应商位置,输入日期 - 创建新的
$ b tblSPInvoiceData上的$ b记录。这部分没问题。


2.如果发票记录已经存在(意味着用户不知道

其他人已经创建了发票,或者说他们需要改变供应商位置的价值,提出现有记录。


我遇到的问题是#2 - 我无法弄清楚如何获得

现有信息以显示在表单上。我理解在编辑

模式下打开,但由于许多字段都是来自键的翻译,我无法想象如何获取表单上的数据进行编辑。我觉得那里有一个带有查询的东西,但是我不知道那会是什么。


很高兴发布任何代码 - 只是不知道什么是有用的。


谢谢 -

Sara

Hi -
I have been struggling with solution ideas for this now for almost 2
weeks, and have not been able to figure this out.

I have a user who creates a Purchase Order (tblPOData). In some
circumstances, this or another user must create an invoice to go with
the PO (I know - that makes no sense, but this is the business
case).

I have the user go to a form to create the invoice:
frmCreateSpInvoice.

The user chooses the PO from a drop down. Then, the user chooses the
vendor location from another drop down.

Fields from each drop-down populate information fields on the form so
the user can see that they are working with the correct PO. (Fields
like Dollar amount on the PO [from PO data table], City and State of
the Vendor, Vendor Contact [from Vendor table]).

Then the user enters the necessary information and prints an invoice.

The frmCreateSpInvoice is based on a table that just holds invoice
data (tblSpInvoiceData) for this vendor (POKey, VendorLocationKey,
PickUpDate, etc).

I am trying to:

1. If the Invoice record - POKey is unique - does not exist, allow
the user to choose a vendor location, enter date - creates a new
record on tblSPInvoiceData. No problem with this part.

2. If the Invoice record already exists (means the user doesn''t know
that someone else created the invoice already, or that they need to
change something like Vendor Location), bring up the existing record.

The problem I''m having is with #2 - I can''t figure out how to get the
existing information to show on the form. I understand open in Edit
mode, but since many fields are translations from keys, I can''t figure
out how to get the data on the form to edit. I figure there''s
something there with a query, but I don''t know what that would be.

Happy to post any code - just don''t know what''s helpful.

Thank you -
Sara

推荐答案

您可以使用

OpenForm命令的WhereCondition将过滤器应用于下一个表单。


sara写道:
You can apply a filter to the next form with the WhereCondition of the
OpenForm command.

sara wrote:

>嗨 -
我一直在为解决方案的想法苦苦挣扎近2周,并且未能想出这个。

我有一个用户创建采购订单(tblPOData)。在某些情况下,这个或另一个用户必须创建一个发票以便与PO一起使用(我知道 - 这没有意义,但这是业务
情况)。

我让用户去表单创建发票:
frmCreateSpInvoice。

用户从下拉列表中选择PO。然后,用户从另一个下拉列表中选择
供应商位置。

每个下拉列表中的字段填充表单上的信息字段,以便用户可以看到它们正在工作使用正确的PO。 (字段
像PO上的美元金额[来自PO数据表],供应商的城市和州,供应商联系[来自供应商表])。

然后用户输入必要的信息并打印发票。

frmCreateSpInvoice基于一个表,该表只包含该供应商的发票数据(tblSpInvoiceData)(POKey,VendorLocationKey,
PickUpDate,等等。

我想:

1。如果发票记录 - POKey是唯一的 - 不存在,则允许用户选择供应商位置,输入日期 - 在tblSPInvoiceData上创建新的
记录。这个部分没问题。

2。如果发票记录已经存在(意味着用户不知道其他人已经创建了发票,或者他们需要更改供应商位置等内容),请调出现有记录。 br />
我遇到的问题是#2 - 我无法弄清楚如何获取表格上显示的现有信息。我理解在编辑
模式下打开,但由于许多字段是按键的翻译,我无法想象如何获取表单上的数据进行编辑。我认为那里有一些查询,但我不知道那是什么。

很高兴发布任何代码 - 只是不知道是什么'很有帮助。

谢谢 -
Sara
>Hi -
I have been struggling with solution ideas for this now for almost 2
weeks, and have not been able to figure this out.

I have a user who creates a Purchase Order (tblPOData). In some
circumstances, this or another user must create an invoice to go with
the PO (I know - that makes no sense, but this is the business
case).

I have the user go to a form to create the invoice:
frmCreateSpInvoice.

The user chooses the PO from a drop down. Then, the user chooses the
vendor location from another drop down.

Fields from each drop-down populate information fields on the form so
the user can see that they are working with the correct PO. (Fields
like Dollar amount on the PO [from PO data table], City and State of
the Vendor, Vendor Contact [from Vendor table]).

Then the user enters the necessary information and prints an invoice.

The frmCreateSpInvoice is based on a table that just holds invoice
data (tblSpInvoiceData) for this vendor (POKey, VendorLocationKey,
PickUpDate, etc).

I am trying to:

1. If the Invoice record - POKey is unique - does not exist, allow
the user to choose a vendor location, enter date - creates a new
record on tblSPInvoiceData. No problem with this part.

2. If the Invoice record already exists (means the user doesn''t know
that someone else created the invoice already, or that they need to
change something like Vendor Location), bring up the existing record.

The problem I''m having is with #2 - I can''t figure out how to get the
existing information to show on the form. I understand open in Edit
mode, but since many fields are translations from keys, I can''t figure
out how to get the data on the form to edit. I figure there''s
something there with a query, but I don''t know what that would be.

Happy to post any code - just don''t know what''s helpful.

Thank you -
Sara



-

HTH - RuralGuy(简称RG)acXP WinXP Pro

请回复此论坛,以便所有人都受益。


通过AccessMonster.com发布的消息
http://www.accessmonster.com/ Uwe / For ... ccess / 200705/1

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200705/1


5月9日下午4:39,ruralguy via AccessMonster.com ; < u12102 @ uwe>

写道:
On May 9, 4:39 pm, "ruralguy via AccessMonster.com" <u12102@uwe>
wrote:

您可以使用
的WhereCondition将过滤器应用于下一个表单
OpenForm命令。



sara写道:
You can apply a filter to the next form with the WhereCondition of the
OpenForm command.

sara wrote:

嗨 -

我现在一直在努力解决这个问题,差不多2个星期,并且无法解决这个问题。
Hi -
I have been struggling with solution ideas for this now for almost 2
weeks, and have not been able to figure this out.


我有一个用户创建采购订单(tblPOData)。在一些

的情况下,这个或另一个用户必须创建一个发票,以便与PO一起使用

(我知道 - 这没有任何意义,但这是业务
案例)。
I have a user who creates a Purchase Order (tblPOData). In some
circumstances, this or another user must create an invoice to go with
the PO (I know - that makes no sense, but this is the business
case).


我让用户去表单创建发票:

frmCreateSpInvoice。
I have the user go to a form to create the invoice:
frmCreateSpInvoice.


用户从下拉列表中选择PO。然后,用户从另一个下拉列表中选择

供应商位置。
The user chooses the PO from a drop down. Then, the user chooses the
vendor location from another drop down.


每个下拉列表中的字段填充表单上的信息字段

用户可以看到他们正在使用正确的PO。 (字段

类似PO上的美元金额[来自PO数据表],城市和州

供应商,供应商联系人[来自供应商表])。
Fields from each drop-down populate information fields on the form so
the user can see that they are working with the correct PO. (Fields
like Dollar amount on the PO [from PO data table], City and State of
the Vendor, Vendor Contact [from Vendor table]).


然后,用户输入必要的信息并打印发票。
Then the user enters the necessary information and prints an invoice.


frmCreateSpInvoice基于一张表,该表只保存此供应商的发票

数据(tblSpInvoiceData)(POKey,VendorLocationKey) ,

PickUpDate等)。
The frmCreateSpInvoice is based on a table that just holds invoice
data (tblSpInvoiceData) for this vendor (POKey, VendorLocationKey,
PickUpDate, etc).


我想:
I am trying to:


1.如果发票记录 - POKey是唯一的 - 不存在,允许用户选择供应商位置,输入日期 - 在tblSPInvoiceData上创建新的
记录。这部分没问题。
1. If the Invoice record - POKey is unique - does not exist, allow
the user to choose a vendor location, enter date - creates a new
record on tblSPInvoiceData. No problem with this part.


2.如果发票记录已经存在(意味着用户不知道

其他人创建了已经发票,或者他们需要改变供应商位置等的b $ b,提出现有记录。
2. If the Invoice record already exists (means the user doesn''t know
that someone else created the invoice already, or that they need to
change something like Vendor Location), bring up the existing record.


我遇到的问题是#2 - 我无法弄清楚如何获得

现有信息显示在表格上。我理解在编辑

模式下打开,但由于许多字段都是来自键的翻译,我无法想象如何获取表单上的数据进行编辑。我认为那里有一个带有查询的东西,但是我不知道那会是什么。
The problem I''m having is with #2 - I can''t figure out how to get the
existing information to show on the form. I understand open in Edit
mode, but since many fields are translations from keys, I can''t figure
out how to get the data on the form to edit. I figure there''s
something there with a query, but I don''t know what that would be.


很高兴发布任何代码 - 只是不知道什么是有用的。
Happy to post any code - just don''t know what''s helpful.


谢谢 -

Sara
Thank you -
Sara



-

HTH - RuralGuy(简称RG)acXP WinXP Pro

请回复此论坛,以便所有人都受益。


消息通过AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/2007 ...发布 - 隐藏引用文字 -


- 显示引用文本 -


--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/2007...- Hide quoted text -

- Show quoted text -



我在开放表单上试过这个,但它不起作用。我无法弄清楚

如何获取某些信息。例如:组合框中的供应商位置是

。在After Update事件中,该组合框中还有大约5个其他字段填充

。我无法弄清楚

如何将VendorLocationKey放入组合框并获得

"翻译"到表格上。 LocationKey转到查询表

告诉我位置城市,州,电话号码,联系信息,特殊

说明。这些都显示在用户的表单上。


Where子句对我不起作用:


''发票存在;打开表格,填写数据进行更新


strFormName =" frmSPInvoice"

strLinkCriteria =" POKey =" &安培; lngPOKey

DoCmd.Close acForm,strFormName


DoCmd.OpenForm strFormName,acNormal ,, strLinkCriteria,

acFormEdit

''在表格上加载密钥,数量和费用

表格!frmSPInvoice.txtPOKey = lngPOKey

表格!frmSPInvoice.txtPONum = lngPONum

表格!frmSPInvoice.txtOurCost = curOurCost


我需要表格上的特殊发票表中的其他字段

当它打开时用户可以编辑,或者看到发票已经准备好打印了。


谢谢

I tried this on the open form, and it doesn''t work. I can''t figure out
how to get certain information. For example: the vendor location is
in a combo box. There are about 5 other fields that are populated
from that combo box in the After Update event. I can''t figure out how
to get the VendorLocationKey into the combo box and get the
"Translations" onto the form. The LocationKey goes to a lookup table
to tell me Location City, State, Phone Number, Contact info, Special
Instructions. These all show on the form for the user.

The Where clause didn''t work for me:

'' Invoice exists; open the form with the data filled in for updating

strFormName = "frmSPInvoice"
strLinkCriteria = "POKey = " & lngPOKey
DoCmd.Close acForm, strFormName

DoCmd.OpenForm strFormName, acNormal, , strLinkCriteria,
acFormEdit
'' Load the Key, Number and Cost on the form
Forms!frmSPInvoice.txtPOKey = lngPOKey
Forms!frmSPInvoice.txtPONum = lngPONum
Forms!frmSPInvoice.txtOurCost = curOurCost

I need the other fields from the special invoice table on the form
when it opens so the user can either edit, or see that the invoice is
all ready to print.

Thanks


听起来在下一个表单上有很多工作要做。您将需要在

OpenForm命令的OpenArgs参数中传递所需的任何数据,并在下一个表单的Load事件中捕获它们并放入

他们需要的地方。


sara写道:
It sounds like there is a lot of work to do on the next form. You will
probably need to pass whatever data you need in the OpenArgs argument of the
OpenForm command and catch them in the Load event of the next form and put
them where they need to be.

sara wrote:

> 5月9日,4日:39 pm,ruralguy via AccessMonster.com < u12102 @ uwe>
写道:
>On May 9, 4:39 pm, "ruralguy via AccessMonster.com" <u12102@uwe>
wrote:

>您可以使用
OpenForm命令的WhereCondition将过滤器应用于下一个表单。
>You can apply a filter to the next form with the WhereCondition of the
OpenForm command.


[引用文字剪辑 - 53行]

[quoted text clipped - 53 lines]


>>
- 显示引用文字 -
>>
- Show quoted text -


我在开放的表单上试过这个,但它不起作用。我无法弄清楚如何获取某些信息。例如:供应商位置在组合框中。在After Update事件中,该组合框中大约有5个其他字段已填充。我无法弄清楚如何将VendorLocationKey放入组合框并获得
翻译。到表格上。 LocationKey转到查询表
告诉我位置城市,州,电话号码,联系信息,特别说明。这些都显示在用户的表单上。

Where子句对我不起作用:

''发票存在;打开表格,填写数据进行更新


strFormName =" frmSPInvoice"

strLinkCriteria =" POKey =" &安培; lngPOKey

DoCmd.Close acForm,strFormName


DoCmd.OpenForm strFormName,acNormal ,, strLinkCriteria,
acFormEdit
''加载表格上的密钥,数量和费用

表格!frmSPInvoice.txtPOKey = lngPOKey

表格!frmSPInvoice.txtPONum = lngPONum

表格!frmSPInvoice。 txtOurCost = curOurCost

我需要打开表单上的特殊发票表中的其他字段,以便用户可以编辑或查看发票已全部准备就绪打印。

谢谢


I tried this on the open form, and it doesn''t work. I can''t figure out
how to get certain information. For example: the vendor location is
in a combo box. There are about 5 other fields that are populated
from that combo box in the After Update event. I can''t figure out how
to get the VendorLocationKey into the combo box and get the
"Translations" onto the form. The LocationKey goes to a lookup table
to tell me Location City, State, Phone Number, Contact info, Special
Instructions. These all show on the form for the user.

The Where clause didn''t work for me:

'' Invoice exists; open the form with the data filled in for updating

strFormName = "frmSPInvoice"
strLinkCriteria = "POKey = " & lngPOKey
DoCmd.Close acForm, strFormName

DoCmd.OpenForm strFormName, acNormal, , strLinkCriteria,
acFormEdit
'' Load the Key, Number and Cost on the form
Forms!frmSPInvoice.txtPOKey = lngPOKey
Forms!frmSPInvoice.txtPONum = lngPONum
Forms!frmSPInvoice.txtOurCost = curOurCost

I need the other fields from the special invoice table on the form
when it opens so the user can either edit, or see that the invoice is
all ready to print.

Thanks



-

HTH - RuralGuy(简称RG)acXP WinXP Pro

请回复此论坛,以便所有人都受益。


通过AccessMonster.com发布消息
http://www.accessmonster.com/Uwe/For...ccess/ 200705/1

--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200705/1


这篇关于加载具有特定记录的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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