Subform Address

G

Guest

I asked this question in another window and think it belongs here.

This should be easy for most... It has been a while so I forget this.

What is the address for a subform from the main form? I want to put buttons
on my main form to update data to a field in my subform. I use the same
subform for three diffrent main forms so I will add buttons to each main form
and in the onClick event I need an address. Here are my names.
Main Form is "ApplicantHistoryChecked"
Subform "CallCommentsT"
Control I want to update is "CallCommentsNotes"
 
G

Guest

Try

Me.[CallCommentsT].Form![CallCommentsNotes]

Me stand for the current main form where the button is in
CallCommentsT need to be the name of the sub form control withinn the main
form
 
S

Sandra Daigle

From the code on the main form:

me.CallCommentsT.form.CallCommentsNotes = 13121

Make sure "CallCommentsT" is 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
"CallCommentsT".

The same reference will work in each main form with the possible exception
that the subform control might be named differently so you would need to
adjust accordingly.
 
G

Guest

It worked but it would not show as updated so I put this line after your line
(see below) and it updates. Is it ok to do this? Seems to work??? I don't
know why it is not updating? When I put the cursor in the subform it shows
there are words in the sub form by the placement of the cursor but the words
are not visible. It works now but let me know if you see any future
problems.

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

THANKS!!!


Ofer said:
Try

Me.[CallCommentsT].Form![CallCommentsNotes]

Me stand for the current main form where the button is in
CallCommentsT need to be the name of the sub form control withinn the main
form

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


Bryan said:
I asked this question in another window and think it belongs here.

This should be easy for most... It has been a while so I forget this.

What is the address for a subform from the main form? I want to put buttons
on my main form to update data to a field in my subform. I use the same
subform for three diffrent main forms so I will add buttons to each main form
and in the onClick event I need an address. Here are my names.
Main Form is "ApplicantHistoryChecked"
Subform "CallCommentsT"
Control I want to update is "CallCommentsNotes"
 
G

Guest

There shouldn't be any problem with saving the records first.

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


Bryan said:
It worked but it would not show as updated so I put this line after your line
(see below) and it updates. Is it ok to do this? Seems to work??? I don't
know why it is not updating? When I put the cursor in the subform it shows
there are words in the sub form by the placement of the cursor but the words
are not visible. It works now but let me know if you see any future
problems.

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

THANKS!!!


Ofer said:
Try

Me.[CallCommentsT].Form![CallCommentsNotes]

Me stand for the current main form where the button is in
CallCommentsT need to be the name of the sub form control withinn the main
form

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


Bryan said:
I asked this question in another window and think it belongs here.

This should be easy for most... It has been a while so I forget this.

What is the address for a subform from the main form? I want to put buttons
on my main form to update data to a field in my subform. I use the same
subform for three diffrent main forms so I will add buttons to each main form
and in the onClick event I need an address. Here are my names.
Main Form is "ApplicantHistoryChecked"
Subform "CallCommentsT"
Control I want to update is "CallCommentsNotes"
 

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