Open a Form with Info from Subform

R

Ripper

I have a continuous subform, subDhall, that contains information about
student D-Halls. For the student selected, all their D-Halls show up. If
one of the d-halls is expired a teacher clicks an expired checkbox an add
discipline form opens. I would like to populate that new form,
frmDisciplineAdd, with 2 fields from the record in the continuous form,
DhallID (Autonumber field) and StudentID. The fields on frmDisciplineAdd
have the same names as the fields on the subform. I don't know how. Anyone
willing to help?
 
T

tina

well, populating 2 fields requires a bit different approach than if you're
only populating one. if the main form (that holds the subform you mentioned)
stays open, then you should be able to refer to the subform fields in the
new form's Load event procedure, as

Me!FieldA = Forms!MainForm!SubformControl.Form!FieldA

make sure that "SubformControl" is the name of the "container" control,
within the main form, that "holds" the subform - NOT the name of the subform
as it shows in the database window. those two names may be the same, or they
may be different.

hth
 
R

Ripper

I get the idea, but I don't know what you mean by subformcontrol. Is that
the name of the subform?

Me!FieldA = Forms!MainForm!SubformControl.Form!FieldA

Me!StudentID=Forms!frmDhallDaily!?SubformControl.form?!studentID

MainForm = frmDhallDaily
subform = subdhall
Field = StudentID
subformcontrol = ?

Sorry to be a beggar!
--
Thanks As Always
Rip


tina said:
well, populating 2 fields requires a bit different approach than if you're
only populating one. if the main form (that holds the subform you mentioned)
stays open, then you should be able to refer to the subform fields in the
new form's Load event procedure, as

Me!FieldA = Forms!MainForm!SubformControl.Form!FieldA

make sure that "SubformControl" is the name of the "container" control,
within the main form, that "holds" the subform - NOT the name of the subform
as it shows in the database window. those two names may be the same, or they
may be different.

hth
 
T

tina

the "subform control" is the "container" control, within the mainform, that
"holds" the subform. to identify its' name (as opposed to the name of the
subform as it shows in the database window), go to
http://home.att.net/~california.db/instructions.html and click on the
SubformControlName link to download a PDF file that illustrates the concept.

hth


Ripper said:
I get the idea, but I don't know what you mean by subformcontrol. Is that
the name of the subform?

Me!FieldA = Forms!MainForm!SubformControl.Form!FieldA

Me!StudentID=Forms!frmDhallDaily!?SubformControl.form?!studentID

MainForm = frmDhallDaily
subform = subdhall
Field = StudentID
subformcontrol = ?

Sorry to be a beggar!
 

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