Navigation to Sub-Forms



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.

.



Relevant Pages

  • Re: Navigation to Sub-Forms
    ... You need to do a 2-step search: first locate the correct PersonID ... 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 ... Set frm = Nothing ...
    (comp.databases.ms-access)
  • Re: How do I make into a dollar format when in a formula?
    ... not been received as of the date of this correspondence, ... "We have been asked to contact you by our client 0, ... Their records indicate that payment has ... This balance may include finance charges. ...
    (microsoft.public.excel.misc)
  • Add Command
    ... My database consists of our clients, products, orders made for clients and ... correspondence of the client ... I have a form, which shows the clients table, with two command buttons. ...
    (microsoft.public.access.forms)
  • Re: Add record Form, close and go to new record in other form
    ... ...I get runtime error: "Object doesn't support this property or method" ... > Set frm = Forms!frmManage ... >> I'm using a separate form to add a new client record. ...
    (microsoft.public.access.forms)
  • Re: adding form objects/code dynamically
    ... do try and get your client to tell you exactly what he/she needs. ... Function ClickEventProc() As Boolean ... Set frm = CreateForm ... ' Add event procedure. ...
    (microsoft.public.access.forms)