Reports unboudn control doesn't fill up on view change

mcdhappy80

Registered User.
Local time
Today, 15:11
Joined
Jun 22, 2009
Messages
347
I have a report which is fueled by a query, but besides that has one unbound text field which is filled with data in the forms Load event.
The report is build to open in acViewReport view but when I switch to Print Preview view the unbound textfield is empty. When i switch back to Report View the text field has data again.
Why does this happen? What causes this?
How do I assure that calculated data is there in all the views?

Thank you
 
how are you 'filling' the data (i.e., what CODE are you using)
 
how are you 'filling' the data (i.e., what CODE are you using)

Why is this so important? I mean, this happend to me twice with wo different codes, so I'm guessing I doesn't have to do anything with code itself but maybe with the event(s) that load the code (the report opens in Report view and then the On Load code triggers and fills the control but when I then SWITCH to Preview report, the on Load event doesn't trigger and maybe thus the control is empty - because the code that should load it didn't trigger). So is there a event that triggers between switching the forms view?

Thank You
 
have you tried throwing your code into the "on current" event instead?


edit: or "on format"... perhaps... try a few!
 
Last edited:
i have also discovered some calculations don't work when using a particular view (i.e., the view itself is incompatible with what is being done, not the switching between views).

have you tried adding the calculated field in the query and filling the data there, then making the textbox bound to that field? (one reason why your code would have been good - if it's a calculation or something that can be done in a query instead of on the report, it's better to do it in the query)
 
and this thread may help explain why showing your code can come in useful. it would immediately show where you have your code, which can sometimes be the crux of the problem.

searching the forums is another good way of getting answers quickly and painlessly.
 
and this thread may help explain why showing your code can come in useful. it would immediately show where you have your code, which can sometimes be the crux of the problem.

searching the forums is another good way of getting answers quickly and painlessly.

Thank You for Your answers Wiklendt, my code works as is, I have no complaints. I have tried the On Current event but the same thing happens. Thea reason I asked this question is because during the development its common to switch between views, and because the code doesn't work in other view, I'm forced to reopen it each time, which is more slow for me during development.

Thanks again, Cheers!
 

Users who are viewing this thread

Back
Top Bottom