PC Review


Reply
Thread Tools Rate Thread

can you restrict a field to lines instead of characters

 
 
jmh
Guest
Posts: n/a
 
      25th Jun 2009

can you restrict a field to lines instead of the number of characters without
changing the size of the field?
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      25th Jun 2009
jmh wrote:
>can you restrict a field to lines instead of the number of characters without
>changing the size of the field?



No, because the number of lines depends on all the font
property settings wherever the field is displayed.

--
Marsh
MVP [MS Access]
 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      25th Jun 2009

On Thu, 25 Jun 2009 06:21:02 -0700, jmh <(E-Mail Removed)> wrote:

>can you restrict a field to lines instead of the number of characters without
>changing the size of the field?


Could you explain what you mean by "lines"???

If you're trying to control the screen space occupied by text in a field, it's
very difficult. Different fonts have different sizes for the characters, and -
except in fixed-pitch fonts, which aren't used much these days - the size will
be very different for "MMMMMMMMMM" and "lllllllll".
--

John W. Vinson [MVP]
 
Reply With Quote
 
jmh
Guest
Posts: n/a
 
      25th Jun 2009

I want to be able to restrict the size of the field to a finite number of
lines but not have it based on character size. I want to be able to have a
space that will let the user add 15 lines of text and my field remain a
constant size.
"John W. Vinson" wrote:

> On Thu, 25 Jun 2009 06:21:02 -0700, jmh <(E-Mail Removed)> wrote:
>
> >can you restrict a field to lines instead of the number of characters without
> >changing the size of the field?

>
> Could you explain what you mean by "lines"???
>
> If you're trying to control the screen space occupied by text in a field, it's
> very difficult. Different fonts have different sizes for the characters, and -
> except in fixed-pitch fonts, which aren't used much these days - the size will
> be very different for "MMMMMMMMMM" and "lllllllll".
> --
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      25th Jun 2009

On Thu, 25 Jun 2009 09:29:01 -0700, jmh <(E-Mail Removed)> wrote:

>I want to be able to restrict the size of the field to a finite number of
>lines but not have it based on character size. I want to be able to have a
>space that will let the user add 15 lines of text and my field remain a
>constant size.


I don't know any way to reliably do so. Even if the user is using the same
font there's a chance that they're using a different version of that font.

I'll ask the other experts if they have any suggestions.
--

John W. Vinson [MVP]
 
Reply With Quote
 
jmh
Guest
Posts: n/a
 
      25th Jun 2009

Thank you

"John W. Vinson" wrote:

> On Thu, 25 Jun 2009 09:29:01 -0700, jmh <(E-Mail Removed)> wrote:
>
> >I want to be able to restrict the size of the field to a finite number of
> >lines but not have it based on character size. I want to be able to have a
> >space that will let the user add 15 lines of text and my field remain a
> >constant size.

>
> I don't know any way to reliably do so. Even if the user is using the same
> font there's a chance that they're using a different version of that font.
>
> I'll ask the other experts if they have any suggestions.
> --
>
> John W. Vinson [MVP]
>

 
Reply With Quote
 
John Spencer MVP
Guest
Posts: n/a
 
      25th Jun 2009

Take a look at Stephen Lebans sample database. It seems to be what you are
looking for.

http://lebans.com/limittextinput.htm

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

jmh wrote:
> Thank you
>
> "John W. Vinson" wrote:
>
>> On Thu, 25 Jun 2009 09:29:01 -0700, jmh <(E-Mail Removed)> wrote:
>>
>>> I want to be able to restrict the size of the field to a finite number of
>>> lines but not have it based on character size. I want to be able to have a
>>> space that will let the user add 15 lines of text and my field remain a
>>> constant size.

>> I don't know any way to reliably do so. Even if the user is using the same
>> font there's a chance that they're using a different version of that font.
>>
>> I'll ask the other experts if they have any suggestions.
>> --
>>
>> John W. Vinson [MVP]
>>

 
Reply With Quote
 
Jack Leach
Guest
Posts: n/a
 
      25th Jun 2009

Not exactly elegant, but would you be able to setup 15 different unbound
textboxes, set some formatting so it looks like its all the same field? Then
take the values and contencate them to do your internal work with. You would
probably want to put some restriction on the length of each line, but there's
no way around that... 15 lines at 2million characters long won't work, either
way you'll need something there.

Here's another even more hairbrained idea... it may be possible to obtain
the properties of the currently selected font (I know you can get the current
font, and I've seen some font stuff buried away in a few Lebans functions,
though admittedly, I have no idea what they do). But, if you could get that
info, maybe you could perform some calculations based on font properties and
the width of the control, and dynamically limit the amount of characters
allowed so that it won't exceed 15 lines or wrap.

--
Jack Leach
www.tristatemachine.com

"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)



"jmh" wrote:

> Thank you
>
> "John W. Vinson" wrote:
>
> > On Thu, 25 Jun 2009 09:29:01 -0700, jmh <(E-Mail Removed)> wrote:
> >
> > >I want to be able to restrict the size of the field to a finite number of
> > >lines but not have it based on character size. I want to be able to have a
> > >space that will let the user add 15 lines of text and my field remain a
> > >constant size.

> >
> > I don't know any way to reliably do so. Even if the user is using the same
> > font there's a chance that they're using a different version of that font.
> >
> > I'll ask the other experts if they have any suggestions.
> > --
> >
> > John W. Vinson [MVP]
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restrict Text Box to 5 Lines Bob Vance Microsoft Access 10 3rd Sep 2009 11:15 PM
Restrict Lines in Text box alistew Microsoft Word Document Management 1 16th Sep 2008 10:36 AM
Can I Restrict Characters From Being Entered? Barney Fyfe Microsoft Excel Discussion 18 5th Jun 2007 10:47 AM
how to restrict chinese characters ?? Agnes Microsoft VB .NET 0 23rd Jul 2005 07:03 AM
How to restrict certain characters in a text field? Oisin Microsoft Access 5 25th Oct 2003 05:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:02 PM.