By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,982 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,982 IT Pros & Developers. It's quick & easy.

Change label in subFORM in report

P: n/a
I have a REPORT with in it a subFORM

Now I have this label (lblMonth) that I want to change.

How should I do this? What would be the proper event to do this?

The lblMonth should contain the name of the month as jan 07

Any ideas?

TIA,

Henro

May 15 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 15 May 2007 01:52:54 -0700, Henrootje <He****@gmail.comwrote:

The Open event of the parent report? Something like:
Me.mysubformcontrol.form.lblMonth.Caption = Format$(Date, "mmm yy")

It's quite unusual to have a subform in a report. Why not a subreport?

-Tom.

>I have a REPORT with in it a subFORM

Now I have this label (lblMonth) that I want to change.

How should I do this? What would be the proper event to do this?

The lblMonth should contain the name of the month as jan 07

Any ideas?

TIA,

Henro
May 15 '07 #2

P: n/a
I made this form but decided that for printingpurposes a report would
be better.
So I copied the form and pasted it as a report.
It then created a report with subforms which actually apart from this
problem looks quite nice and functions pretty well,
I think even faster than doing it all in reports....................

Here is the problem in more detail..............

I will try to explain more in detail

I made a form (with some subforms) and I copied it to a report.
Now I ended up with a REPORT (Report1) that has subFORMS (subForm1)
On the subFORM there is a label whose caption should change depending
on a string that is mentioned in the header of the report.
In short the string would be something like: "Corporate Clients 2007
-
Q1"
Using right() I derive the number '1'
the code should be something like:
Dim Q
Q= right(String, 1)
Select Case Q
Case 1
[Code to change the captionof label1 on subform, something like:]
rpt.REPORT1.Forms!subForm1.label1.caption = "some text"
rpt.REPORT1.Forms!subForm1.label2.caption = "some text"
Case 2
[Code to change the captionof label1 on subform, something like:]
rpt.REPORT1.Forms!subForm1.label1.caption = "some text"
rpt.REPORT1.Forms!subForm1.label2.caption = "some text"
End Select.
This should happen when the report is opened.
I find I can not execute any code in the subforms (just will not be
executed :s)
and when using code above I get an error that the object can not be
found which, according my reading about this subject, has something
to
do wit an incorrect syntax in the rpt.blablabla
part.............................
Any one has any useful suggestions? Please? I have been at this for a
week, might it be that it is a report with subFORMS that is causing
the trouble????
On 15 mei, 16:05, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On 15 May 2007 01:52:54 -0700, Henrootje <Hen...@gmail.comwrote:

The Open event of the parent report? Something like:
Me.mysubformcontrol.form.lblMonth.Caption = Format$(Date, "mmm yy")

It's quite unusual to have a subform in a report. Why not a subreport?

-Tom.
I have a REPORT with in it a subFORM
Now I have this label (lblMonth) that I want to change.
How should I do this? What would be the proper event to do this?
The lblMonth should contain the name of the month as jan 07
Any ideas?
TIA,
Henro- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

May 16 '07 #3

P: n/a
On 16 May 2007 00:26:59 -0700, Henrootje <He****@gmail.comwrote:

subform controls don't have a label1 control, only the forms inside of
the subform controls.
That's why I had the extra ".Form" in my expression. That's like
stepping into the form hosted by the subform control.

-Tom.

>I made this form but decided that for printingpurposes a report would
be better.
So I copied the form and pasted it as a report.
It then created a report with subforms which actually apart from this
problem looks quite nice and functions pretty well,
I think even faster than doing it all in reports....................

Here is the problem in more detail..............

I will try to explain more in detail

I made a form (with some subforms) and I copied it to a report.
Now I ended up with a REPORT (Report1) that has subFORMS (subForm1)
On the subFORM there is a label whose caption should change depending
on a string that is mentioned in the header of the report.
In short the string would be something like: "Corporate Clients 2007
-
Q1"
Using right() I derive the number '1'
the code should be something like:
Dim Q
Q= right(String, 1)
Select Case Q
Case 1
[Code to change the captionof label1 on subform, something like:]
rpt.REPORT1.Forms!subForm1.label1.caption = "some text"
rpt.REPORT1.Forms!subForm1.label2.caption = "some text"
Case 2
[Code to change the captionof label1 on subform, something like:]
rpt.REPORT1.Forms!subForm1.label1.caption = "some text"
rpt.REPORT1.Forms!subForm1.label2.caption = "some text"
End Select.
This should happen when the report is opened.
I find I can not execute any code in the subforms (just will not be
executed :s)
and when using code above I get an error that the object can not be
found which, according my reading about this subject, has something
to
do wit an incorrect syntax in the rpt.blablabla
part.............................
Any one has any useful suggestions? Please? I have been at this for a
week, might it be that it is a report with subFORMS that is causing
the trouble????
On 15 mei, 16:05, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
>On 15 May 2007 01:52:54 -0700, Henrootje <Hen...@gmail.comwrote:

The Open event of the parent report? Something like:
Me.mysubformcontrol.form.lblMonth.Caption = Format$(Date, "mmm yy")

It's quite unusual to have a subform in a report. Why not a subreport?

-Tom.
>I have a REPORT with in it a subFORM
>Now I have this label (lblMonth) that I want to change.
>How should I do this? What would be the proper event to do this?
>The lblMonth should contain the name of the month as jan 07
>Any ideas?
>TIA,
>Henro- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -
May 16 '07 #4

P: n/a
I haqds the same train of thought initially but unfortunately that did
not work, I had to copy everything to reports first.

But thnx for thinking with me!

Henro
On 16 mei, 15:36, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On 16 May 2007 00:26:59 -0700, Henrootje <Hen...@gmail.comwrote:

subform controls don't have a label1 control, only the forms inside of
the subform controls.
That's why I had the extra ".Form" in my expression. That's like
stepping into the form hosted by the subform control.

-Tom.
I made this form but decided that for printingpurposes a report would
be better.
So I copied the form and pasted it as a report.
It then created a report with subforms which actually apart from this
problem looks quite nice and functions pretty well,
I think even faster than doing it all in reports....................
Here is the problem in more detail..............
I will try to explain more in detail
I made a form (with some subforms) and I copied it to a report.
Now I ended up with a REPORT (Report1) that has subFORMS (subForm1)
On the subFORM there is a label whose caption should change depending
on a string that is mentioned in the header of the report.
In short the string would be something like: "Corporate Clients 2007
-
Q1"
Using right() I derive the number '1'
the code should be something like:
Dim Q
Q= right(String, 1)
Select Case Q
Case 1
[Code to change the captionof label1 on subform, something like:]
rpt.REPORT1.Forms!subForm1.label1.caption = "some text"
rpt.REPORT1.Forms!subForm1.label2.caption = "some text"
Case 2
[Code to change the captionof label1 on subform, something like:]
rpt.REPORT1.Forms!subForm1.label1.caption = "some text"
rpt.REPORT1.Forms!subForm1.label2.caption = "some text"
End Select.
This should happen when the report is opened.
I find I can not execute any code in the subforms (just will not be
executed :s)
and when using code above I get an error that the object can not be
found which, according my reading about this subject, has something
to
do wit an incorrect syntax in the rpt.blablabla
part.............................
Any one has any useful suggestions? Please? I have been at this for a
week, might it be that it is a report with subFORMS that is causing
the trouble????
On 15 mei, 16:05, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
On 15 May 2007 01:52:54 -0700, Henrootje <Hen...@gmail.comwrote:
The Open event of the parent report? Something like:
Me.mysubformcontrol.form.lblMonth.Caption = Format$(Date, "mmm yy")
It's quite unusual to have a subform in a report. Why not a subreport?
-Tom.
I have a REPORT with in it a subFORM
Now I have this label (lblMonth) that I want to change.
How should I do this? What would be the proper event to do this?
The lblMonth should contain the name of the month as jan 07
Any ideas?
TIA,
Henro- Tekst uit oorspronkelijk bericht niet weergeven -
- Tekst uit oorspronkelijk bericht weergeven -

May 17 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.