Determine whether test will fit in textbox

I have a continuous form that I am using to display a bunch of text to a 
user, so they can easily scroll through the records.  I'm looking for a 
function which I can run that will tell me whether the text in the textbox is 
completely visible or not.

Ideally, I'd like to use this function in a conditional formatting criteria 
so that if the text exceeds what is visible in the textbox, I can color code 
the textbox.

Any ideas?

-- 
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.

0
Utf
2/26/2008 7:31:00 PM
access.formscoding 7493 articles. 0 followers. Follow

5 Replies
598 Views

Similar Articles

[PageSpeed] 6

Dale,

I think the first thing you should do is test yourself how many characters 
do fit in your textbox while staying visible to read. When you've determined 
that you can use this in your function.

Example: let's say your textbox can store up to 50 characters which will be 
directly visible to the user. You have your controlpoint set.

function DoesItFit (strText as string) as boolean
if len(strtext) <50 then
 DoesItFit=true
else
 DoeItTit=false
end if

end function

Now you can use the boolean value to do your testing with on your form.

hth
-- 
Maurice Ausum


"Dale Fye" wrote:

> I have a continuous form that I am using to display a bunch of text to a 
> user, so they can easily scroll through the records.  I'm looking for a 
> function which I can run that will tell me whether the text in the textbox is 
> completely visible or not.
> 
> Ideally, I'd like to use this function in a conditional formatting criteria 
> so that if the text exceeds what is visible in the textbox, I can color code 
> the textbox.
> 
> Any ideas?
> 
> -- 
> Don''t forget to rate the post if it was helpful!
> 
> email address is invalid
> Please reply to newsgroup only.
> 
0
Utf
2/26/2008 9:43:01 PM
Maurice,

Already thought about that.  It would be a starting point for a single line 
text box, but the one I'm interested in has multiple (5) lines currently 
displayable.  And the text includes CRLF characters etc.

So what I really need is the ability to count the number of rows that will 
be needed to display the text.

Thanks for the suggestion.

-- 
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"Maurice" wrote:

> Dale,
> 
> I think the first thing you should do is test yourself how many characters 
> do fit in your textbox while staying visible to read. When you've determined 
> that you can use this in your function.
> 
> Example: let's say your textbox can store up to 50 characters which will be 
> directly visible to the user. You have your controlpoint set.
> 
> function DoesItFit (strText as string) as boolean
> if len(strtext) <50 then
>  DoesItFit=true
> else
>  DoeItTit=false
> end if
> 
> end function
> 
> Now you can use the boolean value to do your testing with on your form.
> 
> hth
> -- 
> Maurice Ausum
> 
> 
> "Dale Fye" wrote:
> 
> > I have a continuous form that I am using to display a bunch of text to a 
> > user, so they can easily scroll through the records.  I'm looking for a 
> > function which I can run that will tell me whether the text in the textbox is 
> > completely visible or not.
> > 
> > Ideally, I'd like to use this function in a conditional formatting criteria 
> > so that if the text exceeds what is visible in the textbox, I can color code 
> > the textbox.
> > 
> > Any ideas?
> > 
> > -- 
> > Don''t forget to rate the post if it was helpful!
> > 
> > email address is invalid
> > Please reply to newsgroup only.
> > 
0
Utf
2/26/2008 9:59:04 PM
On Tue, 26 Feb 2008 13:59:04 -0800, Dale Fye <dale.fye@nospam.com> wrote:

>So what I really need is the ability to count the number of rows that will 
>be needed to display the text.

Very, Very difficult, if you allow word wrap and variable pitch font. The text
string "MMMMMMMMMMMMMMMMMMMM" takes up a lot more room than the equal length
"llllllllllllllllllll", and different fonts will have different physical
lengths. (I see that the difference fooled Agent's Word Wrap feature in this
very message!)

-- 
             John W. Vinson [MVP]
0
John
2/27/2008 12:19:19 AM
I know it's hard, John.  

I was just hoping someone had figured it out, or at least come up with a 
reasonable assessment based on font type, size and height/width of the 
textbox.

-- 
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"John W. Vinson" wrote:

> On Tue, 26 Feb 2008 13:59:04 -0800, Dale Fye <dale.fye@nospam.com> wrote:
> 
> >So what I really need is the ability to count the number of rows that will 
> >be needed to display the text.
> 
> Very, Very difficult, if you allow word wrap and variable pitch font. The text
> string "MMMMMMMMMMMMMMMMMMMM" takes up a lot more room than the equal length
> "llllllllllllllllllll", and different fonts will have different physical
> lengths. (I see that the difference fooled Agent's Word Wrap feature in this
> very message!)
> 
> -- 
>              John W. Vinson [MVP]
> 
0
Utf
2/27/2008 12:47:00 PM
John,

See my post (Calling function in conditional formatting expression) dated 
today to continue this thread.

-- 
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



"John W. Vinson" wrote:

> On Tue, 26 Feb 2008 13:59:04 -0800, Dale Fye <dale.fye@nospam.com> wrote:
> 
> >So what I really need is the ability to count the number of rows that will 
> >be needed to display the text.
> 
> Very, Very difficult, if you allow word wrap and variable pitch font. The text
> string "MMMMMMMMMMMMMMMMMMMM" takes up a lot more room than the equal length
> "llllllllllllllllllll", and different fonts will have different physical
> lengths. (I see that the difference fooled Agent's Word Wrap feature in this
> very message!)
> 
> -- 
>              John W. Vinson [MVP]
> 
0
Utf
2/27/2008 3:23:03 PM
Reply:

Similar Artilces:

Determine Folders Size from Server
Hello, Does anyone know if there is a way to find out the individual folder size in users' mailboxes? ...

Preserving number format in userform textbox
Is there a way to preserve the number format that is in a userform text box to be the same as the formatting in the sheet source cell For example 85% in the sheet (percent format) reads 0.85 in the text box that reads from that cell Can anyone help? Try Set rng = Range("A1") TextBox1 = Format(rng,rng.NumberFormat) If this post helps click Yes --------------- Jacob Skaria "Roger on Excel" wrote: > Is there a way to preserve the number format that is in a userform text box > to be the same as the formatting in the sheet source cell &g...

Using Excel ActiveX Textbox to populate another worksheet cell
I have a spreadsheet I use to do taxes each year. There are lines corresponding to each line on the 1040. Income is entered on line 7 and I sum(d7:d21). This has always worked fine. I set up a worksheet "form" for my son to use where he only has to enter the appropriate input (wages, interest, dividends, tax withheld, etc.) and I fill the appropriate cells and calculate the taxes. I used "LinkedCell" property to place the text field amount in the appropriate cell, along with amount formatting of the textbox on LostFocus. Problem: The value goes into the ...

Internet explorer 7 will error and close crm 3.0
What could cause this Under what circumstances does this occur ? If CRM always closes immediately then this due to pop-up blockers, otherwise can you post more information about the error and when it occurs -- David Jennaway - Microsoft Dynamics CRM MVP Web: http://www.excitation.co.uk "Mark" wrote: > What could cause this ...

Determining the current row and col
What's the VB syntax for determining the current row and current co prior to a DoubleClick? Thanks k48 -- k48 ----------------------------------------------------------------------- k483's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1079 View this thread: http://www.excelforum.com/showthread.php?threadid=48821 If you mean the cell in which the double click occurred, then one way: Private Sub Worksheet_BeforeDoubleClick( _ ByVal Target As Excel.Range, Cancel As Boolean) With Target MsgBox "Address: " &...

two messages that will not delete...
We are running Exchange 2000 with Outlook 2002 clients. A user has received two email messages that nothing can be done with. If she tries to delete them, an "internal error occurred" message is displayed. Same for forwarding or simply trying to open them... Is there any way I can physically remove user messages on the Exchange server somewhere? Thanks Brad Try OWA. You could also try to Exmerge them out. If those doesn't work you might try running isinteg. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!" "Brad Pears" ...

Will Not Send
I am running Outlook 2003, Windows XP. I have Norton with Worm Blocking turned off. Sometimes Outlook will not send an email. Just sits there. Always if I try to send and get a time out then I can NEVER resend the message. It seems if I delete the message, shut down, and restart the computer then I can resend. Any ideas as to what is going on. Sometimes it works fine. Thanks are you looking in the outbox when this happens? if not, do you have to delete it, will just restarting outlook help, or can you open it and hit resend? -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself...

How to determine regional setting language?
Is it possible to determine with VBA the regional and language options/setting? Thank's ahead. Take a look at the language settings object in VBA. Something like this: Set objLangSet = Application.LanguageSettings MsgBox objLangSet.LanguageID(msoLanguageIDInstall) Useful link: http://cjoint.com/?ejss2NiNg7 HTH -- AP "Bobby" <rpqc@hotmail.com> a �crit dans le message de news:1144507298.968085.37690@j33g2000cwa.googlegroups.com... > Is it possible to determine with VBA the regional and language > options/setting? Thank's ahead. > ...

test
y test ...

Amnesty for illegal immigrants will not happen this time.....................
Our politicians lead the league in all talk, no action. Is blowing us some sunshine good enough? Read what The Expert thinks: http://www.ExpertHumor.com/ *** Free account sponsored by SecureIX.com *** *** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com *** ...

Fit-to-page
Hi everyone! This appears to be an easy one, but I can't find the solution to this question anywhere! If I try to print an email which is wider than an A4 sheet, the text is cropped from the right hand side. I can't find anywhere a setting which makes Outlook print "fit to page". Surely this is an easy solution? Every other bit of software I use can print scaled to a page size ..... -- BarPlanner Hard to say without knowing your version of Outlook. Also, in which format is this message received? HTML, Plain Text, Rich Text? -- Robert Sparnaaij [MVP-O...

Poor fit-to-page printouts #2
How come cell contents become non-printable when the printout is fit to the page? We have worksheets that display and print fine at 100%, but print poorly when fit to the page. In fact, the problem is evident in the print preview even before printing. Shouldn't the program simply reduce all elements so they will print as in normal mode only smaller? For example, in one sheet we have a column of phone numbers formatted with the special format for phone numbers. The column is plenty wide and contains more blank space per cell, including the contents, than many other cells. Notwithst...

phone textbox default value problem
I have a phone field and I have a default area code set and when I tab to the field the area code is highlighted and I have to click off of it to enter data. How can I have it so when I tab to the field I can immediatly start typing the phone number after the area code? If the area code is different than the default I figure I could just back space and change it. 90% of the time the default will be correct. I have the input mask as !\(999") "000\-0000;0;_ and the default value as (916), I am leaving the formatting info in because I have to import the data and it has the...

Outlook 2002 no longer will archive
Hi, I was archiving a 4 GB mailbox by year so as not to exceed the .pst limit and had a need to put all the mail back into the mailbox once I was completed. The first operation when perfectly! Then the putting the mail back went perfectly. When I tried to re-archive the files that is where the problems began... It seems that if you archive files and try to archive them after you put them back into the mailbox they are no longer archivable... WHY? I need to archive this mailbox again because the original archive pst files were lost. Thanks, Scott 4 gig mailboxes are only suppo...

Test Plan for Outlook 2002
I am trying to find a White Paper or Document which can be used as a template for a Test Plan for migrating to Outlook 2002. Has anyone seen such a document? What are you migrating from? Colleen wrote: > I am trying to find a White Paper or Document which can be > used as a template for a Test Plan for migrating to > Outlook 2002. Has anyone seen such a document? ...

Test #10
Test Post ...

Beta Test Anyone?
There are so many people having problems with MS Money 2005 it makes you wonder if they even stopped to run this "product" through beta testing....oh, wait I forgot.....we are the beta test :-( <My name is Mike and I approve this message!> IMHO the program was "chisled in stone" when the testers received it ;I did receive a call from one of the program managers,a "first" after years of "testing" ,hopefully some improvements will be made to the program next year .. "CaptnTrpps" <CaptnTrpps@discussions.microsoft.com> wrote in m...

Outlook Email will reecieve but not send
I have Outlook 2002 with WIndows Xp. My email account was working fine a few days ago. Now it will recieve but not send. I checked all my account setting with my ISP and they say its Outlook. Any ideas? JS On Tue, 14 Oct 2003 15:25:12 -0700, "JS" <jerry@creeklife.net> wrote: >I have Outlook 2002 with WIndows Xp. My email account was >working fine a few days ago. Now it will recieve but not >send. I checked all my account setting with my ISP and >they say its Outlook. Any ideas? > > >JS Go into your email accounts (Tools -> Email Accounts) Th...

Excel Test With Template Wizard
Hi, I�ve been asked to look at making past exam papers into online tests. I don�t know anything about programming, so the way I�ve done it is t use form controls in excel. I was thinking I could set it up as template with data tracking on the network so people could open a cop on their machine, then when they save it, it would feed back into database that could do the marking. I�m ok as far as designing the worksheet so it has option buttons etc for each question. My first problem is that, having created the worksheet, once it i protected, I can�t select any of the option buttons, even...

Need to test a mobo
I had a power surge about 3 weeks ago - lost a drive, now making ticking noises. I had another two drive that seem to work sporadically now. So, I thought it might have been my power supply. Bought a tester and found out that all seems well. Next, I bought a new hard drive and found that it was also acting up - making noises like whirring up and down (like the other drives I thought were dead). So I am starting to wonder if it is my mobo - but how can I test this out? I am using a dual boot - Win XP and Win 7 - both drives work and don't work. Up and down. Right now my Win7 ...

SQL Server 2005 Agent Will Not Start
I have a database server that has three SQL Server 2005 database instances which one I am unable to start the SQL Server 2005 agent. I received the error listed below when I tried to start the agent. Error 1053: The service did not respond to the start or control request in a timely fashion. Please help me with process to resolve this issue. Thank You, On May 28, 7:56=A0pm, Joe K. <J...@discussions.microsoft.com> wrote: Try to check if the service account have proper permissions at OS / SQL Server level. Check the sqlagent.out file also for errors. ...

How do I determine a y value for x ?
I create a chart from data. I now want to use that chart and data to predict the y value for any given value of x. How do I go about doing that in Excel? Is there a way to do curve fitting to get an equation for a curve? HOw do I go about doing any and/or all of this? You can add a trendline to a chart series. You can use the trendline formula (be sure to use enough significant figures to get a reasonable result) or the LINEST worksheet function to get coefficients to compute Y values for known X values. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services, Inc...

see if message will send
hello hello SOS Hi, Marva. We got your message. Do you have a question? RC -- R. C. White, CPA San Marcos, TX rc@grandecom.net Microsoft Windows MVP Windows Live Mail 2009 (14.0.8089.0726) in Win7 Ultimate x64 "Marva Taylor" <brataylo@bellsouth.net> wrote in message news:OgyVw$ooKHA.5696@TK2MSFTNGP04.phx.gbl... > hello hello SOS sos "Marva Taylor" <brataylo@bellsouth.net> wrote in message news:OgyVw$ooKHA.5696@TK2MSFTNGP04.phx.gbl... > hello hello SOS ...

Excel will not allow me to use the funtion MROUND,
Excel will not allow me to use the funtion MROUND, any ideas I am using the expression =MROUND(10, 3) Hi if you receive a #NAME error you have to activate the Analysis Toolpak Add-in. Goto 'Tools - addins' and check this Addin (you may be asked to insert your installation CD) -- Regards Frank Kabel Frankfurt, Germany Paul D wrote: > Excel will not allow me to use the funtion MROUND, any > ideas > > I am using the expression =MROUND(10, 3) The Analysis Toolpack needs to installed. Tools>Addins> Analysis Toolpack. Bye, Cesar Zapata Paul D wrote: > Exc...

test #6
test ...