Senin, 30 Januari 2012

Re: [MS_AccessPros] Re: Width of characters

 

Jane,

Based upon the function for getting text height in Leban's sample (LimitTextInput) I have put together a modified version for returning the width of a text string.

Interestingly, it is also found feasible to get the text width via a light weigh report (No record source, No controls), using its TextWidth function. However, the results returned by report's function are not found consistent across different character sets e.g. string made up purely of W's as against that made up of pure a's.

Sample db Form_TextWidthOnDataEntry.zip uploaded to Samples folder in Files section, demonstrates both methods side by side. As the user type each character into a text box, progressive text width gets displayed in twips / inches / cms.

Best wishes,
A.D. Tejpal
------------

----- Original Message -----
From: Bill Mosca
To: MS_Access_Professionals@yahoogroups.com
Sent: Monday, January 30, 2012 01:17
Subject: RE: [MS_AccessPros] Re: Width of characters

You're welcome, Jane. But do look into Lebans' solution. While I haven't used
that one I have used several others and found them simple to implement.

Regards,

Bill


From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Jane
Sent: Sunday, January 29, 2012 5:30 AM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Width of characters

Thanks Bill
That was my fall-back position. Duane has suggested a Stephen Lebans solution,
so I'll take a look, but it may not be worth the effort & I'll use the 'W's
Many thanks
Jane

--- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , "Bill Mosca" <wrmosca@...>
wrote:
>
> Jane
>
> Pre-printed sheets are the devil's playground. They are a ton of work for the
Access programmer. It reminds me of the days when I had to learn COBOL.
>
> This is kinda hokey, but it's all I can think of...
> I'd test the text box first using all W's since that would be the widest
character (I think). See what fits. Then limit the number of characters to that,
no matter what they are. You can check the length on the Exit event.
>
> But a better solution would be to use fixed-width characters. Why is Arial so
important?
>
> Regards,
> Bill Mosca, Founder - MS_Access_Professionals
> http://www.thatlldoit.com
> Microsoft Office Access MVP
> https://mvp.support.microsoft.com/profile/Bill.Mosca
>
>
>
> --- In MS_Access_Professionals@yahoogroups.com
<mailto:MS_Access_Professionals%40yahoogroups.com> , "Jane" <jcross@> wrote:
> >
> > Hi
> > I have to print a report onto a pre-printed sheet. One of the boxes on the
sheet is 8cm wide. Without using a fixed width font, is there anyway of
determining how wide text will print out on the form - obviously it will depend
upon what the user types & whether they use all uppercase.
> >
> > After the user has entered text I would like a function to calculate the
width that it would print out (Arial, 9pt) & then let the user know if that's
too much - so they can abbreviate.
> >
> > Any suggestions?
> > Many thanks
> > Jane

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar