Navigation to Sub-Forms
- From: loyal2uk@xxxxxxxxxxx
- Date: Wed, 13 Jun 2007 01:11:33 -0700
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.
.
- Follow-Ups:
- Re: Navigation to Sub-Forms
- From: Tom van Stiphout
- Re: Navigation to Sub-Forms
- Prev by Date: Re: Database window is lost - not the typical issue
- Next by Date: Re: How to use a saved cross-tab query in a report?
- Previous by thread: AC07 combo boxes--is this a bug?
- Next by thread: Re: Navigation to Sub-Forms
- Index(es):
Relevant Pages
|