Open main form and companion form with related records

josephbupe

Registered User.
Local time
Today, 07:13
Joined
Jan 31, 2008
Messages
247
I have two forms; a main form (frmPerson) and its companion form (frmPerson_Fingerprints). Their data source tables are linked with a one-to-one relationship and the user usually would open the companion form (Person_Fingerprints) by click of a button on the main form. The code is:

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmPerson_Fingerprints"

stLinkCriteria = "[FprintID]=" & Me![PersonID]

What I would like to do is whenever the main form opens the companion form should also open with it, but only with the record related to the current record in main form.

I will appreciate your help.
:confused:
 
I suggest, make a "frmPerson_Fingerprints" as a subform in "frmPerson".
Link them via LINK CHILD FIELDS and LINK MASTER FIELDS properties.
 
Hi MStef,

Thanks.

The main form has an image control for the criminal/suspects portrait, bio data fields and a subform for crimes data.there ins'nt enough space on it for the fingerprints image controls plus fingerprints classification fields.
 
Yes, you can do it via "Page Break".
Look at "DemoPageBreakA2000.mdb" (attachment, zip).
Open frmMain and push a "PageDown" button on the keyboard,
(PageDown, PageUp). On the lower part of the form you cna see
2 Tabs (Tab1, Tab2).
On Tab1 there is a subform. You can add another subform on Tab2,
(I have got a main form with 14 tabs, and 14 subforms).
But when the focus is on the subform field, if you wont a "PageUp", click on
Tab1 first, then "PageUp", or use a ScrollBar.
 

Attachments

For "PageBreak" look at this attachment (word, zip).
 

Attachments

Ok MStef.

I copied and pasted the same code am using on the on click event of the button on the main form into the on open event of the companion form.

Thanx oncemore.
 

Users who are viewing this thread

Back
Top Bottom