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????
TIA,
Henro
What do you mean exactly, do you want the label to change dynamically or
should it just say jan 07. Either way run in code you could try something
like:
me.(subreportname).controlname.caption="jan 07" where controlname is the
name of the label and subreportname is the name of your subreport.
Sometimes it is neccesary to use the full suntaxis like:
Reports![mainreportname]![subreportname]!controlname.caption="your text"
Remember a label has a caption and not a value.
Maurice
Henrootje said:
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 -