Link a subform

V

Vina

Hello,

I have a form that has a subform.
Main form has Customer ID
and Sub Form has a field Ship ID

I have a command button that open another form(Orders), I
have put Customer id in the orders form = Customer id in
the Main form. Now I need to have the Ship id in the
orders form = to whatever they have in the Ship ID in the
Subform, the subform is a single form. How will i be able
to link that particular ship ID to be displayed in the
(orders form ship id)

Any ideas?

Thanks
Vina
 
S

Sandra Daigle

Hi Vina,

You can get the value of the subform control by using the following type of
reference:

me.sfrmSub1.form.txtMyControl

This will give you the value of the control txtMyControl from the current
record of the subform.

Note that 'sfrmSub1' must be the name of the subform control on the main
form. This is not necessarily the same as the name of the form object that
is referenced in the ControlSource of the subform control. To be sure, open
the main form and click once on the subform then check the name property
under the Other tab. Whatever you find there is what belongs in place of
sfrmSub1.
 
V

Vina

Hi Sandra,

Can you explain it more? Where should i put this? should
i put it in the default value?
-----Original Message-----
Hi Vina,

You can get the value of the subform control by using the following type of
reference:

me.sfrmSub1.form.txtMyControl

This will give you the value of the control txtMyControl from the current
record of the subform.

Note that 'sfrmSub1' must be the name of the subform control on the main
form. This is not necessarily the same as the name of the form object that
is referenced in the ControlSource of the subform control. To be sure, open
the main form and click once on the subform then check the name property
under the Other tab. Whatever you find there is what belongs in place of
sfrmSub1.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Hello,

I have a form that has a subform.
Main form has Customer ID
and Sub Form has a field Ship ID

I have a command button that open another form (Orders), I
have put Customer id in the orders form = Customer id in
the Main form. Now I need to have the Ship id in the
orders form = to whatever they have in the Ship ID in the
Subform, the subform is a single form. How will i be able
to link that particular ship ID to be displayed in the
(orders form ship id)

Any ideas?

Thanks
Vina

.
 
S

Sandra Daigle

Hi Vina,

Just use it the same way you are using Customer id from the main form. I
wasn't sure what you already had going to link the forms so I wasn't sure
what to suggest. Post whatever code you already have if you need more help.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Hi Sandra,

Can you explain it more? Where should i put this? should
i put it in the default value?
-----Original Message-----
Hi Vina,

You can get the value of the subform control by using the following
type of reference:

me.sfrmSub1.form.txtMyControl

This will give you the value of the control txtMyControl from the
current record of the subform.

Note that 'sfrmSub1' must be the name of the subform control on the
main form. This is not necessarily the same as the name of the form
object that is referenced in the ControlSource of the subform
control. To be sure, open the main form and click once on the
subform then check the name property under the Other tab. Whatever
you find there is what belongs in place of sfrmSub1.

--
Sandra Daigle
[Microsoft Access MVP]
For the benefit of others please post all replies to this newsgroup.

Hello,

I have a form that has a subform.
Main form has Customer ID
and Sub Form has a field Ship ID

I have a command button that open another form (Orders), I
have put Customer id in the orders form = Customer id in
the Main form. Now I need to have the Ship id in the
orders form = to whatever they have in the Ship ID in the
Subform, the subform is a single form. How will i be able
to link that particular ship ID to be displayed in the
(orders form ship id)

Any ideas?

Thanks
Vina

.
 

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