-
Solved: setting .text in Report_Open
Does anyone know the trick here, for a textbox control? (A2003)
If I attempt to set .Value: "You can't assign a value to this object"
If I attempt to set .Text: "You can't reference a property or method for a control unless the control has the focus"
If I attempt to .SetFocus: "Microsoft Access doesn't allow you to use this method in the current view."
If I try to set the string in .ControlSource, it attempts to find an object with that name. True, this impels an InputBox to appear for typing in the desired value, but I don't want the user to type anything; the code should stuff the textbox content.
All these make sense; is there some other trick for this?
-
you can do many more things in report events using:
On Fomart
sortdata
-
To add to what sordata has said you need to use the report's "Detail" Event Procedure "on format" to control field attributes.
-
Thanks for the nondrunk of the responses. But what if the textbox is not in the detail section? I'm interested in seeding a textbox in the report header. That's why the thread subject is what it is. (Or are you saying that the thread's subject is impossible?)
Unless!: Is there an event like OnHeader or OnReportHeader? I don't think so, but for anyone knowledgeable: can you point me to a list of each Report Event with the sequence of evaluation? I've seen it in more than one place but it's not Googling for me now.
-
You can also use the Report Header bar's On Format event procedure, I just made a "Label" Invisible on format.
-
Thanks for leading me to ReportHeader_Format, though it has the identical problems mentioned atop here.
In researching this I'm finding all kinds of report properties (e.g. Retreat, Page, Error, NoData); all I need now is a master list of the sequence of firing. One interesting piece is (a/c what I read) that _Open occurs before the query is run.
ReportHeader_Format presumably fires later then Report_Open. So it had a better chance of doing what I want. Hopefully a sequenced list will let me incrementally test to find when .text is first broachable ... and hopefully, that will be before the report header has printed.
One source gave this:
Open(Report)
Activate(Report)
Format(Report Section)
Print(Report Section)
Close(Report)
Deactivate(Report)
-
What exactly do you want to do with the textbox?
-
The order of events is in the Access help file. I'll figure it out from there.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules