Adding watermark to a Access report page -


i trying add watermark access report using "picture" property , have run issue. following code works , image displayed/printed when report previewed , printed not work when report directly printed macro (nothing visible on-screen). "grandtotal" bound text box on report sum of field in record source. appreciate suggestion print watermark both print preview , print macro.

private sub report_load ' put watermark if needed      if grandtotal.value < 2000         me.picture = <<picture file name including full path>>     end if end sub 

since printing report without ever rendering screen open/load events never fired because never used. alternative open report in print preview , use openargs indicate want print it

private sub somebutton_click()     docmd.openreport "detailview", acviewpreview, , , achidden, "print" end sub 

then normal loading stuff

private sub report_load ' put watermark if needed      if grandtotal.value < 2000         me.picture = <<picture file name including full path>>     end if end sub 

and when loading done form activate when can print

private sub report_activate()     if me.openargs = "print"         on error goto errorhandler          docmd.openreport "report1", acviewpreview         'opens print dialog current screen (report in case):         docmd.runcommand accmdprint     end if     docmd.close errorhandler:     if err.number <> 0 , err.number <> 2501         msgbox "error: " & err.number & vbnewline & err.description         exit sub     end if end sub 

the form never shown looks had set before load/open events fire normal because report rendered.


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -