导航到子表单 [英] Navigation to Sub-Forms

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

问题描述

我在A2K中有一个数据库处理客户端的通信 - 基于

表的客户详细信息(tblClients)和一个用于通信 -

(tblLetters )关于一对多关系。详细信息

任何特定字母都以主表格形式显示(frmPersonMain)

,其子表格名为frmSubLetters。后者持有

a特定字母的详细信息。


我可以获得一封特定的信件让客户看上去就好了
$ b当我点击另一种形式的

a命令按钮时,$ b正确的''frmSubLetters''正确的''frmPersonMain''。


问题是什么时候当我在另一个表单上的列表框(LstResponseOverDue)中选择它时,我试图找到一个特定的字母。我可以

到达那里只有当一个字母只与选定的

客户有关时才行。如果客户涉及多个字母,结果

失败,空白的''frmPersonMain''和空白''frmSubLetters''。


我使用以下内容: -


Dim frm As Form

DoCmd.OpenForm" frmPersonMain",_

WhereCondition :=" PersonID =" &安培; Me.LstResponseOverDue

设置frm =表格! frmPersonMain!FrmSubLetters.Form

使用frm.RecordsetClone

.FindFirst" LetterID =" &安培; Me.LstRefundOverDue

如果.NoMatch则

MsgBox未找到

否则

frm.Bookmark = 。书签

结束如果

结束

设置frm =没什么

这就好像命令不能当客户存在多个字母时,选择''PersonID''

或''LetterID'' - 即使

虽然可能只有一个客户对于逾期的信件,在

列表框中标记了这些字母。列表框的数据来自

查询,每次肯定都有IPersonId和LetterID。


删除所有客户信件,除了一个来自表格结果

成功导航。

创建第二个,导致该客户端导航失败。


很奇怪。

解决方案

2007年6月13日星期三01:11:33 -0700, lo ****** @ yahoo.co.uk 写道:


您需要进行两步搜索:首先找到正确的PersonID

记录,然后在该记录中找到正确的字母ID。


-Tom。

< blockquote class =post_quotes>
>我在A2K中有一个DB来处理客户端的通信 - 基于客户端详细信息的表(tblClients)和一个用于通信的表 -
(tblLetters)关于一对多关系。详细信息
任何特定的字母都是使用名为frmSubLetters的子表单以主表单(frmPersonMain)显示
。后者持有特定字母的详细信息。

我可以得到一个特定的字母让客户看起来没问题,即
正确的''frmSubLetters''正确当我点击另一种形式的命令按钮时,'frmPersonMain''

问题是,当我在选择它时,我试图找到一个特定的字母另一个表单上的列表框(LstResponseOverDue)。只有当只有一封与所选
客户有关的信件时,我才能到达那里。如果客户涉及多个字母,结果
失败,空白的''frmPersonMain''和空白''frmSubLetters''。

我使用以下内容: -


尺寸FRM的作为表格

DoCmd.OpenForm" frmPersonMain" ;, _

WhereCondition:="是PersonID = QUOT; &安培; Me.LstResponseOverDue

设置frm =表格! frmPersonMain!FrmSubLetters.Form

使用frm.RecordsetClone

.FindFirst" LetterID =" &安培; Me.LstRefundOverDue

。如果.NoMatch然后

MSGBOX"未发现"

,否则

frm.Bookmark = 。书签

结束如果
结束
设置frm = Nothing

这就好像命令无法接收''PersonID' '
或''LetterID''当客户存在多个字母时 - 甚至
虽然可能只有一个客户的字母在
列表框中标记为过期字母。列表框的数据来自
查询,IPersonId和LetterID每次都肯定存在。

删除除表格中的一个以外的所有客户信件结果
成功导航。
创建第二个,导航失败的客户端。

很奇怪。


6月13日15:18,Tom van Stiphout< no.spam.tom7 ... @ cox.netwrote:
< blockquote class =post_quotes>
2007年6月13日星期三01:11:33 -0700,忠诚... @ yahoo.co.uk写道:


你需要进行两步搜索:首先找到正确的PersonID

记录,然后在该记录中找到正确的字母ID。



这两步方法是否必要,因为命令是在列表框中启动的?

我问的原因是因为几乎相同的代码工作

完全是从另一种形式的另一个子表单中启动的,即

它从子表单的一行启动,配置为

连续的形式。在这种情况下的代码如下: -

尺寸FRM的作为表格

DoCmd.OpenForm" frmPersonMain" ;, _

WhereCondition:= PersonID = &安培; Me.PersonID


组FRM =形式frmPersonMain FrmSubLetters.Form

随着frm.RecordsetClone

.FindFirst"!LetterID = &安培; Me.LetterID

如果.NoMatch则

MsgBox未找到

否则

frm.Bookmark = 。书签

结束如果

结束

设置frm =没什么


在这两种情况下,代码似乎分为两个阶段,但我的查询是

这两个阶段如何更明显地分割,因为你看起来好像是b $ b暗示了什么?

请耐心等待我,因为我是亲戚新手。


6月13日15:18,Tom van Stiphout< no。 spam.tom7 ... @ cox.netwrote:


2007年6月13日星期三01:11:33 -0700,忠诚... @ yahoo.co。 uk写道:


您需要进行两步搜索:首先找到正确的PersonID

记录,然后在该记录中找到正确的字母ID。


-Tom。



我一直在挖掘它并且问题似乎是

在线: -


.FindFirst" LetterID =" &安培; Me.LstRefundOverDue


所以它似乎没有从列表框中取出LetterID。

问题是我们如何参考它?


I have a DB in A2K that handles client''s correspondence - based on a
table for client details (tblClients) and one for correspondence -
(tblLetters) on a one to many relationship.The detailled information
any particular letter is displayed in a master form (frmPersonMain)
with a sub Form called frmSubLetters. The latter holds the details of
a particular letter.

I can get a single particular letter for a client to appear OK ie the
correct ''frmSubLetters'' in the correct ''frmPersonMain'' when I click on
a command button in another form.

The problem is when I try to get to a single particular letter when I
select it in a list box (LstResponseOverDue) on another form. I can
get there OK only if there is one letter only related to the selected
client. Where the client relates to more than one letter, the result
is failure with a blank ''frmPersonMain'' and a blank ''frmSubLetters''.

I am using the following:-

Dim frm As Form
DoCmd.OpenForm "frmPersonMain", _
WhereCondition:="PersonID = " & Me.LstResponseOverDue
Set frm = Forms! frmPersonMain!FrmSubLetters.Form
With frm.RecordsetClone
.FindFirst "LetterID = " & Me.LstRefundOverDue
If .NoMatch Then
MsgBox "not found"
Else
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing
It is just as though the command cannot pick up the either ''PersonID''
or the ''LetterID'' when multiple letters exist for a client - even
though there may be just one of the client''s letters flagged up in the
list box for overdue letters. The data for the list box comes from a
query and both IPersonId and LetterID are definately there every time.

Removing out all a clients letters except one from the table results
in successful navigation.
Create a second, and the navigation fails for that client.

Weird.

解决方案

On Wed, 13 Jun 2007 01:11:33 -0700, lo******@yahoo.co.uk wrote:

You need to do a 2-step search: first locate the correct PersonID
record, then within that record find the correct Letter ID.

-Tom.

>I have a DB in A2K that handles client''s correspondence - based on a
table for client details (tblClients) and one for correspondence -
(tblLetters) on a one to many relationship.The detailled information
any particular letter is displayed in a master form (frmPersonMain)
with a sub Form called frmSubLetters. The latter holds the details of
a particular letter.

I can get a single particular letter for a client to appear OK ie the
correct ''frmSubLetters'' in the correct ''frmPersonMain'' when I click on
a command button in another form.

The problem is when I try to get to a single particular letter when I
select it in a list box (LstResponseOverDue) on another form. I can
get there OK only if there is one letter only related to the selected
client. Where the client relates to more than one letter, the result
is failure with a blank ''frmPersonMain'' and a blank ''frmSubLetters''.

I am using the following:-

Dim frm As Form
DoCmd.OpenForm "frmPersonMain", _
WhereCondition:="PersonID = " & Me.LstResponseOverDue
Set frm = Forms! frmPersonMain!FrmSubLetters.Form
With frm.RecordsetClone
.FindFirst "LetterID = " & Me.LstRefundOverDue
If .NoMatch Then
MsgBox "not found"
Else
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing
It is just as though the command cannot pick up the either ''PersonID''
or the ''LetterID'' when multiple letters exist for a client - even
though there may be just one of the client''s letters flagged up in the
list box for overdue letters. The data for the list box comes from a
query and both IPersonId and LetterID are definately there every time.

Removing out all a clients letters except one from the table results
in successful navigation.
Create a second, and the navigation fails for that client.

Weird.


On 13 Jun, 15:18, Tom van Stiphout <no.spam.tom7...@cox.netwrote:

On Wed, 13 Jun 2007 01:11:33 -0700, loyal...@yahoo.co.uk wrote:

You need to do a 2-step search: first locate the correct PersonID
record, then within that record find the correct Letter ID.

Would this two step approach be necessary just because the command is
initiated in a list box?

The reason I ask is because the virtually identical code works
perfectly when it is initated from another sub form in another form ie
it gets initiated from one line of the sub form which is configured as
continuous forms. The code in this case is as follows:-
Dim frm As Form
DoCmd.OpenForm "frmPersonMain", _
WhereCondition:="PersonID = " & Me.PersonID

Set frm = Forms!frmPersonMain!FrmSubLetters.Form
With frm.RecordsetClone
.FindFirst "LetterID = " & Me.LetterID
If .NoMatch Then
MsgBox "not found"
Else
frm.Bookmark = .Bookmark
End If
End With
Set frm = Nothing

In both cases, the code appears to be in two stages but my query is
how can these two stages be split more distinctly as you appear to
imply?

Please bear with me as I am a relative Newbie.


On 13 Jun, 15:18, Tom van Stiphout <no.spam.tom7...@cox.netwrote:

On Wed, 13 Jun 2007 01:11:33 -0700, loyal...@yahoo.co.uk wrote:

You need to do a 2-step search: first locate the correct PersonID
record, then within that record find the correct Letter ID.

-Tom.

I''ve been digging around it a bit more and the problem appears to be
in line:-

.FindFirst "LetterID = " & Me.LstRefundOverDue

So it appears not to be picking up the LetterID from the list box.
Question is how can we reference to it?


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

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