A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Text Align



 
 
Thread Tools Display Modes
  #1  
Old February 24th, 2006, 12:15 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old February 24th, 2006, 03:11 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old February 24th, 2006, 03:23 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old February 24th, 2006, 04:57 AM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old February 24th, 2006, 12:47 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old February 24th, 2006, 01:19 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old February 26th, 2006, 07:31 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old February 26th, 2006, 09:03 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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  
Old February 26th, 2006, 09:21 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 08:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.