find a bug to Lebans's AutoSizeTextBox

Hi Stephen,

Recently, I used on my form a your example, http://www.lebans.com/autosize_textbox.htm,
to resize automatically the width of text box to fit its content.
Of course it works great and I am very happy about it.
But If I try to insert this symbol &, the box doesn't fit any more the
text in it!
I tried even with your example, if I add a new record and write on any
text box ''Dog & Cat''. It doen't works but if I try with ''Dog and
Cat'' it works great.
Why!!

Please let me known any idea about that!
Many thanks
Stefano

0
riccifs
9/7/2007 3:45:21 PM
access.forms 6864 articles. 2 followers. Follow

4 Replies
498 Views

Similar Articles

[PageSpeed] 33

I haven't tried it but have you tried doubling up the ampersand?  "&&"

riccifs@tin.it wrote:
>Hi Stephen,
>
>Recently, I used on my form a your example, http://www.lebans.com/autosize_textbox.htm,
>to resize automatically the width of text box to fit its content.
>Of course it works great and I am very happy about it.
>But If I try to insert this symbol &, the box doesn't fit any more the
>text in it!
>I tried even with your example, if I add a new record and write on any
>text box ''Dog & Cat''. It doen't works but if I try with ''Dog and
>Cat'' it works great.
>Why!!
>
>Please let me known any idea about that!
>Many thanks
>Stefano

-- 
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200709/1

0
ruralguy
9/7/2007 4:06:21 PM
yes I have... there is no way, if yuo insert the & or &&, the code stop to 
works.
thanks the same...
Stefano.

"ruralguy via AccessMonster.com" <u12102@uwe> wrote in message 
news:77de3394cfe90@uwe...
>I haven't tried it but have you tried doubling up the ampersand?  "&&"
>
> riccifs@tin.it wrote:
>>Hi Stephen,
>>
>>Recently, I used on my form a your example, 
>>http://www.lebans.com/autosize_textbox.htm,
>>to resize automatically the width of text box to fit its content.
>>Of course it works great and I am very happy about it.
>>But If I try to insert this symbol &, the box doesn't fit any more the
>>text in it!
>>I tried even with your example, if I add a new record and write on any
>>text box ''Dog & Cat''. It doen't works but if I try with ''Dog and
>>Cat'' it works great.
>>Why!!
>>
>>Please let me known any idea about that!
>>Many thanks
>>Stefano
>
> -- 
> HTH - RuralGuy (RG for short) acXP WinXP Pro
> Please post back to this forum so all may benefit.
>
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200709/1
> 


0
Stefano
9/7/2007 4:36:45 PM
Here is the info direct from MSDN on the DrawText API call I use in that 
solution:
http://msdn2.microsoft.com/en-us/library/ms533909.aspx
Turns off processing of prefix characters. Normally, DrawText interprets the 
mnemonic-prefix character & as a directive to underscore the character that 
follows, and the mnemonic-prefix characters && as a directive to print a 
single &. By specifying DT_NOPREFIX, this processing is turned off. For 
example,
input string:   "A&bc&&d"
normal:         "Abc&d"
DT_NOPREFIX:    "A&bc&&d"Compare with DT_HIDEPREFIX and DT_PREFIXONLY.





So at the top of the modfAutosizeMultiCode module add the following 
declaration:

Private Const DT_NOPREFIX = &H800



Now scroll down to the DrawText call itself and change it from the existing:

 lngRet = apiDrawText(hdc, ctl.Value, -1, sRect, DT_CALCRECT + DT_TOP + 
DT_LEFT)

to

 lngRet = apiDrawText(hdc, ctl.Value, -1, sRect, DT_CALCRECT or DT_TOP or 
DT_LEFT or DT_NOPREFIX )

' Please note I also changed the "+" to "Or" as you must Or the Flags 
together when combining them. In this case you do not have to due to the 
DrawText Flag values,




-- 

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


<riccifs@tin.it> wrote in message 
news:1189179921.055537.321260@r29g2000hsg.googlegroups.com...
> Hi Stephen,
>
> Recently, I used on my form a your example, 
> http://www.lebans.com/autosize_textbox.htm,
> to resize automatically the width of text box to fit its content.
> Of course it works great and I am very happy about it.
> But If I try to insert this symbol &, the box doesn't fit any more the
> text in it!
> I tried even with your example, if I add a new record and write on any
> text box ''Dog & Cat''. It doen't works but if I try with ''Dog and
> Cat'' it works great.
> Why!!
>
> Please let me known any idea about that!
> Many thanks
> Stefano
> 


0
Stephen
9/8/2007 6:43:13 PM
On 8 Set, 20:43, "Stephen Lebans" <ForEmailGotoMy.WebSite.-
WWWdotlebansdot...@linvalid.com> wrote:
> Here is the info direct from MSDN on the DrawText API call I use in that
> solution:http://msdn2.microsoft.com/en-us/library/ms533909.aspx
> Turns off processing of prefix characters. Normally, DrawText interprets the
> mnemonic-prefix character & as a directive to underscore the character that
> follows, and the mnemonic-prefix characters && as a directive to print a
> single &. By specifying DT_NOPREFIX, this processing is turned off. For
> example,
> input string:   "A&bc&&d"
> normal:         "Abc&d"
> DT_NOPREFIX:    "A&bc&&d"Compare with DT_HIDEPREFIX and DT_PREFIXONLY.
>
> So at the top of the modfAutosizeMultiCode module add the following
> declaration:
>
> Private Const DT_NOPREFIX = &H800
>
> Now scroll down to the DrawText call itself and change it from the existing:
>
>  lngRet = apiDrawText(hdc, ctl.Value, -1, sRect, DT_CALCRECT + DT_TOP +
> DT_LEFT)
>
> to
>
>  lngRet = apiDrawText(hdc, ctl.Value, -1, sRect, DT_CALCRECT or DT_TOP or
> DT_LEFT or DT_NOPREFIX )
>
> ' Please note I also changed the "+" to "Or" as you must Or the Flags
> together when combining them. In this case you do not have to due to the
> DrawText Flag values,
>
> --
>
> HTH
> Stephen Lebanshttp://www.lebans.com
> Access Code, Tips and Tricks
> Please respond only to the newsgroups so everyone can benefit.
>
> <ricc...@tin.it> wrote in message
>
> news:1189179921.055537.321260@r29g2000hsg.googlegroups.com...
>
> > Hi Stephen,
>
> > Recently, I used on my form a your example,
> >http://www.lebans.com/autosize_textbox.htm,
> > to resize automatically the width of text box to fit its content.
> > Of course it works great and I am very happy about it.
> > But If I try to insert this symbol &, the box doesn't fit any more the
> > text in it!
> > I tried even with your example, if I add a new record and write on any
> > text box ''Dog & Cat''. It doen't works but if I try with ''Dog and
> > Cat'' it works great.
> > Why!!
>
> > Please let me known any idea about that!
> > Many thanks
> > Stefano

Hi Stephen,
Many, many thanks again for your great help.... you fixed the
problem!!
Now your code is working very well!
Are you a genius or what...!?

Thanks a lot again,
Stefano.

0
riccifs
9/9/2007 8:05:49 AM
Reply:

Similar Artilces:

XP linking to external cells bug?
to link to cells across sheets or books you can simply: type '=' in the local book navigate to the cell(s) on the external book it's a documented technique and works perfectly with previous versions of XL - Excel XP seems to be unreliable at this - sometimes it doesn't seem to create the link? I've put this down to the fact that XP runs multiple XL books as independant applications, and possibly dependant on how you open each book - but i don't know for sure and i need this to work reliably Anyone noticed this bug? if so, anyone know how to make it work reliably ...

Find & Replace #5
Thanks for your help in advance. Have cells containing various dates, Ex. 070306. Data in these cells copied from a WORD Doc. Want dates display as follows: 07/03/2006. Help, Find & replace does not allow me to change different dates. Can't tell from your example if you're using: mmddyy OR ddmmyy But you can change your data to XL recognizable dates by using TTC, Text T Columns. Select the column of dates, and from the Menu bar: <Data> <Text To Column> <Next> <Next> Click on "Date", And *make sure* that the next box contains the format de...

How to find DSN info in an Excel 2003 File
I've got a project that's driving me bonkers. I have a series of Excel files that use DSN to update/refresh information in them. I have DSNs on my system for most of them, however, there are a handful of files, for which no one here knows the connection information or name for the DSNs it uses. I need any combination of the following: 1. Where is the DSN information (System DSNs apparently) stored for each Excel file? 2. How can I find the DSN information the file is trying to use (to create the DSN myself)? Thanks ...

Item Find Field
Please add "Supplier Reorder Number" as searchable field in the Item Find window. M$, Making the Item Find window customizable would be a better all around solution. i.e. Choosing which fields are returned, choosing which fields to add to the searchable fields and automatically bringing up the find window and searching for possible matches when the item is not found at the transaction screen. "Ed Balda" <EdBalda@discussions.microsoft.com> wrote in message news:4BE4C456-F6E9-4D18-9457-EFE424D7986B@microsoft.com... > Please add "Supplier Reorder Number&...

Replacing one text with three in IF(ISERROR(FIND.......Max
I have this formula. =IF(ISERROR(FIND("Relief",MasterTab!O21)),"",MAX(A$1:A1)+1) can it be modified to find three different things instead of "relief". I'd like it to find: (FLM) (FL) and (M) ? Much thanks, Steve Hi, I have not tried this - please check if it works =IF(ISERROR(FIND({"FLM","FL","M"},MasterTab!O21)),"",MAX(A$1:A1)+1) -- Regards, Ashish Mathur Microsoft Excel MVP www.ashishmathur.com "Steve" <Steve@discussions.microsoft.com> wrote in message news:...

find smallest positive number among datas
How to find the smallest positive number among datas in Excel? Try =MIN(data_rng) -- HTH Bob "Cerberus" <Cerberus@discussions.microsoft.com> wrote in message news:8616B833-5582-4FCE-A23C-5F10D577AF63@microsoft.com... > How to find the smallest positive number among datas in Excel? =MIN(IF(A1:A6>0,A1:A6)) as an array formula (Control Shift Enter) Adjust your range to suit. -- David Biddulph "Cerberus" <Cerberus@discussions.microsoft.com> wrote in message news:8616B833-5582-4FCE-A23C-5F10D577AF63@microsoft.com... > H...

urgent: can't save advanced find view
Hi, we have reinstalled MSCRM, and after that users can't save the advanced find view. Error says: "you don't have permissions to CRM object". Account, from who the CRM was installed, has this ability, but even if I give other user the Domain Administrator role, it still can't save that view. Please for quick help. It sounds like your users don't have permisions setup. 1) Visit Settings/Business Unit/ Security Roles and make sure they have Read, Write access ect 2) Go to the user profile (Settings/Business Unit/User)and make sure the profile doesn't have re...

where do I find my Forwarded emails? They arent in my Sent folder
My computer at home does not showme all the emails that I have forwarded. I would like to find them. The computer at work saves them in my "Sent" folder automatically for me. How do I set this up at home? Any forwarded messages SHOULD show in the "Sent" folder without you having to do anythign to set it up.. "cepicky" <cepicky@discussions.microsoft.com> wrote in message news:3837675F-556B-4DB1-99C3-6052FB6BE97E@microsoft.com... > My computer at home does not showme all the emails that I have forwarded. > I > would like to find them. The comp...

How do I get UML profile on Visio 2003, I can't seem to find it?
My laptop has visio 2003 installed on it, but I can't find the UML profile, so I can do activity diagrams, class diagrams etc. I followed the instructions in online help http://office.microsoft.com/en-au/visio/HP815502391033.aspx? pid=CH010267621033, but that option doesn't come up, must I install the component? Thanks Andy Maybe you only have Visio Standard, not Visio Professional? http://www.qbssoftware.com/DDGzone/product_brochure.asp?product=MSVISIO#fea "Andius" <Andius@discussions.microsoft.com> wrote in message news:7ABAB5D0-409A-431B-9A46-AAB733A97A42@mi...

Archiving bug
When I archive folders only some emails archive others don't. For example I archived from a folder and it archived some of my emails not all and I had the date set as todays date. It kept one email from November and some from December but others on the same dates it archived?? Is there a fix for this? Outlook uses the modified date for archiving. Add the modified column to your folder to see this date and I bet that the mail that did not archive had been accessed recently. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the ...

How can I find all cells that do NOT contain an "@" symbol?
Hello! I am trying to filter a list over nearly 4000 email addresses. Some of the entries are bogus and do not contain an "@" symbol. Is there an easy way to find and sort by these cells so I can delete them? Thanks! Gregg Hill Click on Data>Filter>Auto Filter and set a custom filter so that "show rows where" "does not contain" and enter "@" into the next field. CLick OK and you should end up with a list where the e-mail address has no @ in it. "Gregg Hill" wrote: > Hello! > > I am trying to filter a list over near...

Bug in Excel?
Hi. If you create a .csv file, and you only paste the value "ID;xy" into it, and open it in Excel from explorer, Excel crashes. I've tested the behavior on Excel 2000, 2002 and 2003. Both Danish and English version. If you open up Excel, and import the .csv file manually, Excel does not crash. I was unable to find any KB article that mentions this problem. Is it a bug or misuse of the product? Comments.. It looks like a bug to me (also xl2003, USA version). (I don't think that any data should cause a program to crash like this.) But when the first two characters of...

"Microsoft Reporting Error" bug in Tiger?
Office 2004's "Microsoft Reporting Error" sub-application or script, itself, appears to have bugs. On every single occasion that it's been activated during Entourage or Word operations, "Microsoft Reporting Error" freezes, together with either Word or Entourage. Force-quit, then, has failed to quit either "MRE" or the in-trouble Office application. Today, I was able to quit the processes via the Activity Monitor but, on other occasions, after MRE is dancing in the dock (but never functioning), it has jammed even Activity Monitor and normal Finder s...

Skipping A-pay bug
Has anyone discovered a cause/fix for the skipping a-pay bug? For those of you not familiar with it, the symptoms are: - A monthly apay is setup in bills and deposits (First payment Jan 07) - After the first payment (on Jan 07) the next payment in bills and deposits shows the next due date two months out (Mar 07) - A month after the first payment, the bank actually process the second monthly payment as scheduled (on Feb 07) - The next payment now shows FOUR months out (Jun 07) Somehow B&D gets confused and appears to "double book" both its entry and the banks downloaded entr...

Send Email Bug in Publisher 2003?
I believe my client has found a bug in Publisher 2003. I've been able to reproduce it on several PC's so far with Windows XP Pro and Office Professional 2003 with all updates from office.microsoft.com applied. Please see below and recommend. Here's how to reproduce: 1- Create a document with MS Publisher 2003 2- Save the document and close Publisher 3- Re-open the document 4- Select File | Save As, and provide a new name for the document 5- Modify the document 6- Select File | Send Email | Send Publication as Attachement 7- Open the attachment in the resulting new Outlook mess...

Using Find on Calc. Cols.
I am trying to search a column of date that contains dates that were calculated. (starting date + # of days out = end date). I am using the following search macro code. This code works when the date is entered into the column. It does not work when the date is calculated with the above formula. Any ideas why this doesn't work for a calculated field? Sub Find_Date() Dim dteVariable As Date dteVariable = #5/1/2007# FindDate ActiveSheet.Range("u1:u100"), dteVariable End Sub Public Sub FindDate(r As Range, target As Variant) Dim r1 As Range Set r1 = r...

Find and replace for comments in excel 2003
Hi , Actually i need the bulk updations in the comments in Excel 2003, For eg. In excel i have few cells in every cell i need to update specific word with another word like find /replace. please can you give me out needful information for my requirement. Thanks, omprakash Dear Omprakash you can use following macro select the cells you want to make changes in comment & run this macro. Please dont forget to experiment this with on small part of file or backup copy. i have written the code just now & tested it but not sure of any bug Sub ReplaceinComment() Dim temp1 As String, ...

Can't find my functions
When setting up a ribbon I can't find the functions in my fctGeneral module. I always get the error message : Can't run the macro or callback function 'On RibbonLoad' This is my ribbon setup in a USysRibbons table: <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnRibbonLoad"> <ribbon startFromScratch="false"> <tabs> <tab id="tabHome" label="Exporter" visible="true"> <group id="grpDossier" label="Dossier&quo...

Where to find any free daily historical data for currency?
Does anyone have any suggestions on where to find any free daily historical data for currency? Thanks in advance for any suggestions Eric ...

Finding File Extension from Full Filename (VBA) (2007)
Is there a better way of extracting the file extension from a full filename? What I've got works BUT thought there may be a better way of writing it ... Particularly when some people have some very weird filenames with lots of "." and my current code only caters for 4 "."! You would think that would be enough but. New to VBA but trying my best :o) Column A contains full filename: ..bmp emailssent2003-4, 4-5.pst A Person and B Person. Workshop C. Fire Safety Guidance..ppt File With Dot No Extension. Column B contains: =FileExt($A1,"EXT&quo...

How do I find Onenote to install ?
I own Office 2007 license and have it installed. I don't see any reference to OneNote. I tried to re-install using customize options and still find no reference to OneNote. I thought it should be included with Office 2007 license. kmslick wrote: >I own Office 2007 license and have it installed. I don't see any > reference to OneNote. I tried to re-install using customize options > and still find no reference to OneNote. I thought it should be > included with Office 2007 license. NO. OneNote only was included in *some* Versions of Office 2007. Which version d...

Macro to Find, Cut, and Paste
I have 2 LONG columns that I need to make into MANY. I want to find a word in the active column, cut from that word down to the end and the adjacent cells; then paste them at the top of the next column. and do this for all occurences of that word. I'm confused about the two columns. I'm thinking that you want to break up your list of two columns based on the word in column A. But paste both columns to the adjacent columns. So this: $H$1 $B$1 $H$2 $B$2 $H$3 $B$3 $H$4 $B$4 $H$5 $B$5 $H$6 $B$6 $H$7 $B$7 aaaa $B$8 $H$9 $B$9 $H$10 $B$10 $H$11 $B$11 $H...

How to find project type of a vc project
Hello Every body I want to know that how can I find the type of project from a vc++ project i.e If I have a sample project how can I know its type such as dialog, sdi, mfc extension dll, mfc regular dll, com dll, atl project, win32 static/dynamic dll etc. Thanx in advance Waiting for reply Asif If your using VC++6 then you can get that from the .dsp file. At the top of the file there is a define TARGETTYPE, the hex code on the end of this identifies various things. I do not have the specifics of this code, but if your like most of us, you have multiple projects and can make a fai...

Find the cell ID of last row in the column and use it in SUMIF for
Hi, I have this formula to find the cell ID of the last row in a column: =ADDRESS(MATCH(9.99999999999999E+307,'IT hours'!A:A),1) eg.. if the result is $A$933 I want to use this Cell ID in a SUMIF formula. SUMIFS('IT Ratio'!$A$4:$A$933,'IT Ratio'!$A$4:$A$118,'For SLR'!E$17,.....) ie. to replace the $A$933 in the formula, so that the sumifs will work dynamically. May I know what should be the syntax for this? Appreciate any help. Thanks, YY. I am not sure how this is going to help; but to use that reference in your formula use INDIRECT() ...

I am not able to find product key for ms office 2007 trail versio
I am not able to find product key for ms office 2007 trail version where did you get the installation from? Manesh Joseph wrote: > I am not able to find product key for ms office 2007 trail version ...