If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Text Align
Hi, Access 2002.
I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
#2
|
|||
|
|||
Text Align
Try in the On Format event of the section containing the control.
-- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi, Access 2002. I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
#3
|
|||
|
|||
Text Align
Hi Duane, nice idea.... unfortunitly it has the same outcome.
Thanks Jonathan "Duane Hookom" wrote: Try in the On Format event of the section containing the control. -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi, Access 2002. I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
#4
|
|||
|
|||
Text Align
This worked for me. I place a text box (txtCount) in the detail section with
a running sum to get values 1, 2, 3,.... Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.txtCount Mod 2 = 1 Then Me.FirstName.TextAlign = 1 Else Me.FirstName.TextAlign = 3 End If End Sub -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi Duane, nice idea.... unfortunitly it has the same outcome. Thanks Jonathan "Duane Hookom" wrote: Try in the On Format event of the section containing the control. -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi, Access 2002. I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
#5
|
|||
|
|||
Text Align
Since the code the poster used had "ctl" as the control reference, I suspect
the poster was looping through the controls collection and try to set TextAlign for all controls. Not all controls have a TextAlign property and therefore the error message. I think we need to see more of the code. "Duane Hookom" wrote in message ... This worked for me. I place a text box (txtCount) in the detail section with a running sum to get values 1, 2, 3,.... Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.txtCount Mod 2 = 1 Then Me.FirstName.TextAlign = 1 Else Me.FirstName.TextAlign = 3 End If End Sub -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi Duane, nice idea.... unfortunitly it has the same outcome. Thanks Jonathan "Duane Hookom" wrote: Try in the On Format event of the section containing the control. -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi, Access 2002. I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
#6
|
|||
|
|||
Text Align
Good catch John.
-- Duane Hookom MS Access MVP -- "John Spencer" wrote in message ... Since the code the poster used had "ctl" as the control reference, I suspect the poster was looping through the controls collection and try to set TextAlign for all controls. Not all controls have a TextAlign property and therefore the error message. I think we need to see more of the code. "Duane Hookom" wrote in message ... This worked for me. I place a text box (txtCount) in the detail section with a running sum to get values 1, 2, 3,.... Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.txtCount Mod 2 = 1 Then Me.FirstName.TextAlign = 1 Else Me.FirstName.TextAlign = 3 End If End Sub -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi Duane, nice idea.... unfortunitly it has the same outcome. Thanks Jonathan "Duane Hookom" wrote: Try in the On Format event of the section containing the control. -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi, Access 2002. I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
#7
|
|||
|
|||
Text Align
Thanks for staying with this.... the lines of code a
**** code start **** Dim ctl As Access.control Const cLeftAlign As Byte = 1 Const cRightAlign As Byte = 3 'For Bus numbers have data right aligned If CInt(Me.OpenArgs) = cRightAlign Then For Each ctl In Me.Section(0).Controls 'Check whether is a data line control If Left(LCase(ctl.Name), 4) = "line" Then ctl.TextAlign = cRightAlign End If DoEvents Next ctl End If *** Code End *** The Textboxes (and 'yes', after John's observation I have checked the control type :-) ) names each begin with 'line'. Many thanks Jonathan "Duane Hookom" wrote: Good catch John. -- Duane Hookom MS Access MVP -- "John Spencer" wrote in message ... Since the code the poster used had "ctl" as the control reference, I suspect the poster was looping through the controls collection and try to set TextAlign for all controls. Not all controls have a TextAlign property and therefore the error message. I think we need to see more of the code. "Duane Hookom" wrote in message ... This worked for me. I place a text box (txtCount) in the detail section with a running sum to get values 1, 2, 3,.... Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.txtCount Mod 2 = 1 Then Me.FirstName.TextAlign = 1 Else Me.FirstName.TextAlign = 3 End If End Sub -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi Duane, nice idea.... unfortunitly it has the same outcome. Thanks Jonathan "Duane Hookom" wrote: Try in the On Format event of the section containing the control. -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi, Access 2002. I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
#8
|
|||
|
|||
Text Align
Jonathan,
Are you suggesting this now works or do you still get an error? -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Thanks for staying with this.... the lines of code a **** code start **** Dim ctl As Access.control Const cLeftAlign As Byte = 1 Const cRightAlign As Byte = 3 'For Bus numbers have data right aligned If CInt(Me.OpenArgs) = cRightAlign Then For Each ctl In Me.Section(0).Controls 'Check whether is a data line control If Left(LCase(ctl.Name), 4) = "line" Then ctl.TextAlign = cRightAlign End If DoEvents Next ctl End If *** Code End *** The Textboxes (and 'yes', after John's observation I have checked the control type :-) ) names each begin with 'line'. Many thanks Jonathan "Duane Hookom" wrote: Good catch John. -- Duane Hookom MS Access MVP -- "John Spencer" wrote in message ... Since the code the poster used had "ctl" as the control reference, I suspect the poster was looping through the controls collection and try to set TextAlign for all controls. Not all controls have a TextAlign property and therefore the error message. I think we need to see more of the code. "Duane Hookom" wrote in message ... This worked for me. I place a text box (txtCount) in the detail section with a running sum to get values 1, 2, 3,.... Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.txtCount Mod 2 = 1 Then Me.FirstName.TextAlign = 1 Else Me.FirstName.TextAlign = 3 End If End Sub -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi Duane, nice idea.... unfortunitly it has the same outcome. Thanks Jonathan "Duane Hookom" wrote: Try in the On Format event of the section containing the control. -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi, Access 2002. I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
#9
|
|||
|
|||
Text Align
Hi Duane, sorry about the confusion. In fact is was still not working until
your post prompted to look at my code again... blushIt was absence of good naming convention/blush The code was falling over when it hit a real line control! Thanks, Jonathan "Duane Hookom" wrote: Jonathan, Are you suggesting this now works or do you still get an error? -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Thanks for staying with this.... the lines of code a **** code start **** Dim ctl As Access.control Const cLeftAlign As Byte = 1 Const cRightAlign As Byte = 3 'For Bus numbers have data right aligned If CInt(Me.OpenArgs) = cRightAlign Then For Each ctl In Me.Section(0).Controls 'Check whether is a data line control If Left(LCase(ctl.Name), 4) = "line" Then ctl.TextAlign = cRightAlign End If DoEvents Next ctl End If *** Code End *** The Textboxes (and 'yes', after John's observation I have checked the control type :-) ) names each begin with 'line'. Many thanks Jonathan "Duane Hookom" wrote: Good catch John. -- Duane Hookom MS Access MVP -- "John Spencer" wrote in message ... Since the code the poster used had "ctl" as the control reference, I suspect the poster was looping through the controls collection and try to set TextAlign for all controls. Not all controls have a TextAlign property and therefore the error message. I think we need to see more of the code. "Duane Hookom" wrote in message ... This worked for me. I place a text box (txtCount) in the detail section with a running sum to get values 1, 2, 3,.... Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.txtCount Mod 2 = 1 Then Me.FirstName.TextAlign = 1 Else Me.FirstName.TextAlign = 3 End If End Sub -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi Duane, nice idea.... unfortunitly it has the same outcome. Thanks Jonathan "Duane Hookom" wrote: Try in the On Format event of the section containing the control. -- Duane Hookom MS Access MVP -- "Jonathan" wrote in message ... Hi, Access 2002. I want to use the same report for 2 sets of data. One set is text, the other is numeric. What I want is the ability to align the text at report time. I have tried the report_open event and the detail1_print. I get the error: "Object doesn't support this property or method" on the line: ctl.TextAlign = cRightAlign fyi cRightAlign=3 Any ideas or recommendations appreciated :-) Many thanks, Jonathan |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need Feedback on table setup | Little Penny | Database Design | 1 | December 28th, 2005 11:32 AM |
Newbie table Layout (Posted as suggested by Tom Lake for feedback) | Little Penny | Using Forms | 2 | December 25th, 2005 04:44 PM |
Word applies direct format on File open | Uriel | General Discussion | 16 | November 27th, 2005 07:22 PM |
Help with design | Ronnie | Database Design | 6 | March 12th, 2005 02:53 PM |
Outline | Renee Hendershott | Page Layout | 2 | December 25th, 2004 02:49 PM |