tab control and forms

G

Guest

I have a form that contains many tab controls (4 of them). On each tab
control, I put a form on it. My question is how can I relate a [StudentId]
field on a form on a tab control to other forms on other tab controls.

Thank you,
 
G

Guest

Try in the sub report where you need the StudentId field

Forms![MainFormName]![SubFormName].Form![StudentId]

Or

Me.Parent.[SubFormName].Form![StudentId]
 
G

Guest

Thank you for your help. I am still confused. Let me restate my situation
again. I have a form, say, frmStudentInfo, on which have 4 tab controls. On
the first tab control1, I put form1. On the second tab control2, I put form2
and so on. The [StudentID] is on the form1 of the tab contro1. I would like
to have this field to be all other forms because all of these forms show
information about a particualar student.

If you say, [MainFormName] or [Parent], does that mean the form1 on the
tab1? And the [subformname] means form2, and so on?

Ofer said:
Try in the sub report where you need the StudentId field

Forms![MainFormName]![SubFormName].Form![StudentId]

Or

Me.Parent.[SubFormName].Form![StudentId]


--
\\// Live Long and Prosper \\//
BS"D


Tim said:
I have a form that contains many tab controls (4 of them). On each tab
control, I put a form on it. My question is how can I relate a [StudentId]
field on a form on a tab control to other forms on other tab controls.

Thank you,
 
G

Guest

[MainFormName] = the name where the TAB control is located in
[SubFormName] = the control name of the sub form [Form1]
[StudentID] = the name of the field

If you want to reference this field in the SQL of each of the other forms
then use
Forms![MainFormName]![SubFormName].Form![StudentId]

The Parent will work only from the code of each form, not the SQL

--
\\// Live Long and Prosper \\//
BS"D


Tim said:
Thank you for your help. I am still confused. Let me restate my situation
again. I have a form, say, frmStudentInfo, on which have 4 tab controls. On
the first tab control1, I put form1. On the second tab control2, I put form2
and so on. The [StudentID] is on the form1 of the tab contro1. I would like
to have this field to be all other forms because all of these forms show
information about a particualar student.

If you say, [MainFormName] or [Parent], does that mean the form1 on the
tab1? And the [subformname] means form2, and so on?

Ofer said:
Try in the sub report where you need the StudentId field

Forms![MainFormName]![SubFormName].Form![StudentId]

Or

Me.Parent.[SubFormName].Form![StudentId]


--
\\// Live Long and Prosper \\//
BS"D


Tim said:
I have a form that contains many tab controls (4 of them). On each tab
control, I put a form on it. My question is how can I relate a [StudentId]
field on a form on a tab control to other forms on other tab controls.

Thank you,
 
G

Guest

I will try that. Thank you for your help.
tim

Ofer said:
[MainFormName] = the name where the TAB control is located in
[SubFormName] = the control name of the sub form [Form1]
[StudentID] = the name of the field

If you want to reference this field in the SQL of each of the other forms
then use
Forms![MainFormName]![SubFormName].Form![StudentId]

The Parent will work only from the code of each form, not the SQL

--
\\// Live Long and Prosper \\//
BS"D


Tim said:
Thank you for your help. I am still confused. Let me restate my situation
again. I have a form, say, frmStudentInfo, on which have 4 tab controls. On
the first tab control1, I put form1. On the second tab control2, I put form2
and so on. The [StudentID] is on the form1 of the tab contro1. I would like
to have this field to be all other forms because all of these forms show
information about a particualar student.

If you say, [MainFormName] or [Parent], does that mean the form1 on the
tab1? And the [subformname] means form2, and so on?

Ofer said:
Try in the sub report where you need the StudentId field

Forms![MainFormName]![SubFormName].Form![StudentId]

Or

Me.Parent.[SubFormName].Form![StudentId]


--
\\// Live Long and Prosper \\//
BS"D


:

I have a form that contains many tab controls (4 of them). On each tab
control, I put a form on it. My question is how can I relate a [StudentId]
field on a form on a tab control to other forms on other tab controls.

Thank you,
 
G

Guest

What you show me is at the running time (i.e, programmatically). Can you show
me how to do it in designing time? Can I put a textbox on the second form (on
the second tab) and make it bound to StudentId and so on???

Tim said:
I will try that. Thank you for your help.
tim

Ofer said:
[MainFormName] = the name where the TAB control is located in
[SubFormName] = the control name of the sub form [Form1]
[StudentID] = the name of the field

If you want to reference this field in the SQL of each of the other forms
then use
Forms![MainFormName]![SubFormName].Form![StudentId]

The Parent will work only from the code of each form, not the SQL

--
\\// Live Long and Prosper \\//
BS"D


Tim said:
Thank you for your help. I am still confused. Let me restate my situation
again. I have a form, say, frmStudentInfo, on which have 4 tab controls. On
the first tab control1, I put form1. On the second tab control2, I put form2
and so on. The [StudentID] is on the form1 of the tab contro1. I would like
to have this field to be all other forms because all of these forms show
information about a particualar student.

If you say, [MainFormName] or [Parent], does that mean the form1 on the
tab1? And the [subformname] means form2, and so on?

:

Try in the sub report where you need the StudentId field

Forms![MainFormName]![SubFormName].Form![StudentId]

Or

Me.Parent.[SubFormName].Form![StudentId]


--
\\// Live Long and Prosper \\//
BS"D


:

I have a form that contains many tab controls (4 of them). On each tab
control, I put a form on it. My question is how can I relate a [StudentId]
field on a form on a tab control to other forms on other tab controls.

Thank you,
 
J

Jeff

Tim said:
I have a form that contains many tab controls (4 of them). On each tab
control, I put a form on it. My question is how can I relate a [StudentId]
field on a form on a tab control to other forms on other tab controls.

Thank you,


Hi Tim,

The mainform should have a textbox with the [StudentID].

Get the other forms to Refer to that textbox

Click the tabControl on the mainform (NOT the subform)
In the Properties set master and child fields as "StudentID" (without
the quotes)
do this for each form on each tabPage

If the mainform [StudentID] = 17
All the other subforms will be filtered to 17 as well

Hope this helps

Jeff C
 
G

Guest

Hi Jeff:
Thank you for your help. It sounds reasonable to me. Actually, I have a
combo box not the textbox for [StudentID] but I think it's the same as the
text box.

Thank you again.
tim



Jeff said:
Tim said:
I have a form that contains many tab controls (4 of them). On each tab
control, I put a form on it. My question is how can I relate a [StudentId]
field on a form on a tab control to other forms on other tab controls.

Thank you,


Hi Tim,

The mainform should have a textbox with the [StudentID].

Get the other forms to Refer to that textbox

Click the tabControl on the mainform (NOT the subform)
In the Properties set master and child fields as "StudentID" (without
the quotes)
do this for each form on each tabPage

If the mainform [StudentID] = 17
All the other subforms will be filtered to 17 as well

Hope this helps

Jeff C
 

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