How to refer data from a subform to another subform inside a form

  • Thread starter Thread starter Bon
  • Start date Start date
B

Bon

Hello all

I created a main form (frmMain) in MS Access 2000.

Inside the frmMain, there is a subform called frm_datascope which is
used to get clients personal information from the database.

Beside this, there is another subform called frm_appointment under the
subform frm_datascope which is used to get clients appointments and
display in the frm_appointment.

When a user click a record on the frm_datascope, the selected client's
appointment will be displayed in the frm_appointment. But, some common
information will be displayed in the frm_appointment including client's
name, title.. etc.

How can I get the data frm_datascope to the frm_appointment. Both of
subforms, I used textboxes for displaying information.

I tried to put ControlSource =[frm_datascope].[forms]![firstname] for
example in the frm_appointment properties. When I run the application,
there is a dialog popped up and ask for IDs such as clientID. How can I
solve the problem?

I am a newbie to MS Access vba. Could anyone tell me what I have to set
in the form and what methods I have to use as well as where I have to
put them.

Thank you very much

Cheers
Bon
 
The syntax you're using is to get data from a subform of the form the code
is running on. If I understand you, this second subform isn't a subform of
the first, but a subform of the main form. If that is the case, you need to
go up to the main form then back down to the second subform. That would
change your expression to:

=[Parent].[frm_datascope].[forms]![firstname]
 
Back
Top