WHERE are you executing the code? Which event of the report? It could be as simple as you need to move your code to a different event.
Perhaps the format event of the relevant section - the section that contains the control lblHeading,
"Debra Ann" <DebraAnn[ at ]discussions.microsoft.com> wrote in message news:BE576559-EEB2-4DF2-830E-AD75E0D421D8[ at ]microsoft.com...
[Quoted Text] > John, > > I did make a break point and found out that it contains nothing. Maybe I > need to do this another way. Let me give you more detail. > > I have a report that is opening by a macro. The macro opens the report > and > sets the filter. I want to change either a text box or a label caption in > my > title to say "Internal References". What can I use in the macro after the > report opens to tell it to place the title in the label? I tried SetValue > but that didn't work. I don't know what else I can do. I have about > fifteen > macros that open the report and need different titles depending on each > macro. > > Any help would be greatly appreciated as I have spent too much time of > trying to figure this one out. > > Thanks John, > > Debra Ann > -- > Debra Ann > > > "John Spencer" wrote: > >> Perhaps Me.Filter isn't what you think it is. It is possible that the >> apostrophes got changed to quotation marks, or that the Parentheses are >> not >> there, or ... >> >> Try adding a debug.print statement, msgbox, or setting a break point on >> the >> code to check the value. >> >> Msgbox "The Filter is " & me.Filter >> >> If Me.Filter = "([Type] = 'IR')" Then >> Me.lblHeading.Caption = "Internal References" >> Else >> Me.lblHeading.Caption = "New Activities Report" >> End If >> >> >> "Debra Ann" <DebraAnn[ at ]discussions.microsoft.com> wrote in message >> news:3419CBA4-CACF-4F80-A0C5-A32C0FBF7B31[ at ]microsoft.com... >> >I have the following code but I am doing something wrong with the "if >> > me.fitler" part of the statemenet since it always comes up with the >> > label >> > New >> > Activities Report even when it is an Internal Reference. What is wrong >> > with >> > the syntax? >> > >> > If Me.Filter = "([Type] = 'IR')" Then >> > Me.lblHeading.Caption = "Internal References" >> > Else >> > Me.lblHeading.Caption = "New Activities Report" >> > End If >> > >> > Thanks >> > -- >> > Debra Ann >> >> >>
|