Brad Marks
BradM at blackforestltd.com
Sat Oct 30 06:54:43 CDT 2010
A.D., Yes, I did read your earlier post and I appreciate the assistance. I have experimented with your suggestion. I am still digging into this problem, more out of curiosity than anything else. I am still learning about Access and I like to understand why things work (or not work). For example in the "On Paint" Event Me.Box1.BackColor = vbBlue Works nicely But the command Me.Box1.Width = 1000 does not work within the "On Paint" Event. This puzzles me. I would like to understand why. Thanks again for your help. Maybe I am "over thinking" this whole deal. Sincerely, Brad -----Original Message----- From: accessd-bounces at databaseadvisors.com on behalf of A.D. Tejpal Sent: Fri 10/29/2010 11:41 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Friday Puzzler - Access 2007 - "Report View" "OnFormat"and "On Paint" Events Brad, It is not clear whether you happened to connect my post of 29-Oct-2010 (copy placed below), suggesting a way to fire the format event by transitioning from report view to print preview by double click on page header. This was in response to your thread "How tosuppressspecificreportlineswhileusingacViewReport" If the proposed approach was found successful, action on similar lines could be considered for realizing your current objective as well. Best wishes, A.D. Tejpal ------------ ----- Original Message ----- From: A.D. Tejpal To: Access Developers discussion and problem solving Sent: Friday, October 29, 2010 14:48 Subject: Re: [AccessD] How tosuppressspecificreportlineswhileusingacViewReport Brad, Apparently you wish to play with the report in report view and thereafter, before printing, carry out selective suppression of detail section, say by setting Cancel = True in its format event, as dictated by suitable conditional check. Following course of action is suggested (based upon Access 2010 on Win XP): Place suitable code in detail section's format event in report's module. Sample code: '=============================== Private Sub Detail_Format(Cancel As Integer, _ FormatCount As Integer) If <<MyConditionExpression>> Then Cancel = True End If End Sub '=============================== Place the following code in dbl click event of page header section in report's module: '=============================== Private Sub PageHeaderSection_DblClick(Cancel As Integer) DoCmd.RunCommand acCmdPrintPreview End Sub '=============================== After opening the report, whenever you are ready for final stage, dbl click in page header section, will take you to the preview mode, accompanied by firing of format event, delivering desired output. Best wishes, A.D. Tejpal ------------ ----- Original Message ----- From: Brad Marks To: Access Developers discussion and problem solving Sent: Saturday, October 30, 2010 01:11 Subject: [AccessD] Friday Puzzler - Access 2007 - "Report View" "On Format"and "On Paint" Events When using "Report View" in Access 2007, the "On Format" event is not fired (we need to use "Report View" features). The "On Paint" event, however, is fired. In the "On Paint" Event Me.Box1.BackColor = vbBlue Works nicely However the command Me.Box1.Width = 1000 issues the message "The setting you entered isn't valid for this property", although this exact command will work with a test button. Is there a way to resolve this? I would guess that other Access 2007 users have run into similar issues with Report View. Thanks, Brad -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.