same subform used in two different forms

K

Kathy R.

Hi Folks,

Is it possible to use the same subform in two different main forms
simultaneously? If it's possible, is it good practice? I can foresee
that there may be problems with code, but the subform I'm thinking of is
very basic.

Three tables:

tblFamily
FamID (primary key)
FamLastName

tblIndividual
IndID (primary key)
InFamID
FirstName
MiddleName
....other personal data

tblAddress
AddressID
AdFamID
street
city
state
zip

Two main forms for different types of data entry

frmFamily with family information on the main form and address
information in the subform (sfrAddress) (also has sfrIndividual to enter
basic Individual information).

frmIndividual with detailed Individual information on the main form and
the address information on a subform. The address information on this
form is really just for display purposes and not data entry, although I
don't think that it needs to be restricted as such.

It's possible that both frmFamily and frmIndividual will be open at the
same time. Can I and should I use the same sfrAddress?

Thanks for your help.

Kathy R.
 
A

Allen Browne

Access is fine with running 2 instances of a form simultaneously. No
problem. Sometimes I even put multiple instances of a subform on the one
form.

There's no problem with code. Just use Me and it understands the right form.
Or you can use Forms!Form1!Sub1 and Forms!Form2!Sub1 -- Access will
understand. Even if you place multiple instances on the one form, they will
each have different names for the subform controls, so you can still refer
to them easily.
 
D

doug

Allen Browne wrote on 03/02/2010 19:15 ET :
Access is fine with running 2 instances of a form simultaneously. No
problem. Sometimes I even put multiple instances of a subform on the one
form.

There's no problem with code. Just use Me and it understands the right form.
Or you can use Forms!Form1!Sub1 and Forms!Form2!Sub1 -- Access will
understand. Even if you place multiple instances on the one form, they will
each have different names for the subform controls, so you can still refer
to them easily.

Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.


"Kathy R." wrote in message
Hi Allen,
I am reworking part of my database and to simplify I would like to use the sam
subform twice on one form. I want buttons on the subform to behave differentl
depending on which instance is in use. Using me.parent returns the parent for
name, but how do I find which control on the parent form has established eac
instance of the subform?

Thanks!
Doug
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top