Blank Print Preview

alaric01

New member
Local time
Tomorrow, 02:48
Joined
Oct 7, 2010
Messages
3
Hi i am using access 2007. I have a problem with report print preview.

a simple code such as

Code:
Me.txt_jumlah_grand_total = "test"

will work perfectly in the report view. However when I view it in Print Preview it shows blank.

My Report is actually more complicated than this, but even the simple code above is not working in print preview.

i've tried to place the code in the report's open and load event but none of them work.

any idea?
 
Is the textbox bound or unbound? I would imagine unbound.

Why not set the value in the underlying record source then set the control source to that field?
 
hi thx for the reply :)

the text box is unbound and it's dynamic. the value depends on a value in a form. so i need to set the value using vba code
 
:)

What kind of calculation are you performing? May I see the expression?
 
the calculation is perform in the report. it's not a calculation it's a filtering actually. However there's a textbox in the form (based on the filter result) that i would like to display in the report.

my code

Code:
Me.txt_jumlah_grand_total = Forms!frm_sales_report.txt_jumlah_grand_total.value

as i mentioned before it will show up perfectly in report view but shows nothing in print preview
 
Put this in the query of your report as an alias field:

Code:
[COLOR=Blue][B]AliasName[/B][/COLOR]: [Forms]![frm_sales_report]![txt_jumlah_grand_total]
Change AliasName to the field name you would like to call it and use that name as the Control Source of Me.txt_jumlah_grand_total.

OR

Save the value in a variable in the ON LOAD event of your report and set the value of the textbox to that variable. This is so that it refers to the textbox once.
 
Last edited:
Actually, I would suggest using the FORMAT event of the appropriate section (wherever the text box is located) and NOT the Load or Open event.
 
The value is static, rather than refer to the value of the textbox several times on the format event, why not just get the value once, perform any calculations and save it into a variable, then set it ONCE?
 
The value is static, rather than refer to the value of the textbox several times on the format event, why not just get the value once, perform any calculations and save it into a variable, then set it ONCE?
If it is in a header or footer and not in the detail section it will only do it once.
 

Users who are viewing this thread

Back
Top Bottom