PDA

View Full Version : align text to left side not right in lbl



Trevor
04-16-2008, 01:54 PM
I'm tryin to align text to the left side of the label instead of right and not having any luck

Dim Clstrsub as string
Dim strcls As String
ClstrSub = Nz(DLookup("[Setting]", "SettingsTbl", "[VarSettingName] = 'Cluster Sub Label'"), "none") ' lookup value to place in label88
Me.[Label88].Caption = Trim(ClstrSub) & ":" place value in label88 and remove leading and trailing spaces

' I have tried label88 = left(clstrsub) ' error arg not allowed

' left(label88) no luck same error
' I have also tried with no luck
strcls = len(clstrsub)
Left(label88, strcls)

Thanks for helping in advance

FrymanTCU
04-16-2008, 03:08 PM
I'm not sure but isn't the left() function intended to trim the string? Why can't you just set the label formatting in design mode?

Trevor
04-16-2008, 03:24 PM
I just thaught of setting left align is design mode durring my brake, and your right about left() function trimming from the left side (same with right() If this were VB but VBA Trim() will Trim left and right
so I'll try, that then post what happens , thanks FryMan

Trevor
04-16-2008, 03:28 PM
I just tried changing text alignment to the right side , no luck
then just for fun tried to set reading order left to right' and no change

Carl A
04-16-2008, 04:51 PM
The rest of the constant can be access via Access Help File!!!
This aligns left

Private Sub Form_Load()
Me.Label5.TextAlign = 1

End Sub

Trevor
04-16-2008, 07:47 PM
Carl, That worked , thanks, I got my left and right mixed up I used right, but that looked weird so left it left align, is there away to prgramably move the associated textbox up againt the label? what label proporty should I use,if Any? The label with atuto adjusts to the variable entered (well shinks) And I would like to move the assaciated textbox up againt the lable to the left of the textbox.