[AccessD] Displaying TAB as [Chr(9)] in a text control

David Fenton dfenton at ozemail.com.au
Mon Jul 28 04:55:05 CDT 2003


>To John, Charles and Lambert
>
>Thank you all for your insights. It's good to discover 'why' things work 
>as they do. Regarding the vbCRLF and vbTab - these constants are not 
>recognised by Access inside a textbox so that's why I resorted to the 
>chr(13) & chr(10). Progressing from there, I naturally thought that the 
>chr(9) would work also, as I needed a consistent tab distance, but now I 
>know why it won't. I solved the problem by splitting the data and 
>positioning two textboxes on the report at the correct tab distance apart, 
>thus ensuring the data lined up properly.
>Thank you again for your advice. I enjoy reading many of the posts and 
>continue to learn a great deal.
>
>Cheers
>David Ô¿Ô¬
>Australia
>
>------------------------------
>Message: 14
>Date: Wed, 23 Jul 2003 11:48:00 -0400
>From: "Heenan, Lambert" <Lambert.Heenan at AIG.com>
>Subject: RE: [AccessD] Displaying TAB as [Chr(9)] in a text control
>To: "'Access Developers discussion and problem solving'"
>         <accessd at databaseadvisors.com>
>
>As others have pointed out, the native Access textbox does not support tabs
>or other special characters. In your case you could try replacing Chr(9)
>with String(4," ") to get four (or whatever number you want) spaces inserted
>into the textbox.
>
>Lambert
>
>------------------------------
>Message: 18
>Date: Wed, 23 Jul 2003 09:10:40 -0400
>From: <jcolby at colbyconsulting.com>
>Subject: RE: [AccessD] Displaying TAB as [Chr(9)] in a text control
>To: "Access Developers discussion and problem solving"
>         <accessd at databaseadvisors.com>
>
>I can't help you directly with that however I do recommend that you replace
>the rather cryptic chr(x) with the constants (which are readable in English)
>vbCRLF, vbTab etc.  Just better programming style.
>
>John W. Colby
>www.colbyconsulting.com
>
>------------------------------
>Message: 19
>Date: Wed, 23 Jul 2003 08:27:42 -0500
>From: "Wortz, Charles" <CWortz at tea.state.tx.us>
>Subject: RE: [AccessD] Displaying TAB as [Chr(9)] in a text control
>To: "Access Developers discussion and problem solving"
>         <accessd at databaseadvisors.com>
>
>David,
>
>I think your problem is due to the fact that text fields within Access 
>reports do not support tab settings.  In the RTF document tab settings are 
>recognized so during the formatting event the tab character acts as a 
>formatting command that executes a macro that generates enough white space 
>to get the next character to print at the position of the next tab stop.
>
>Since there are no tab stops within Access report text fields, the tab 
>character is not treated as a formatting command but rather as an 
>unprintable character.  The vbCRLF is about the only formatting character 
>that is recognized inside Access report text fields.
>
>I hope that answers your question as to why.  Sorry, but I cannot give you 
>an answer as to how to get around this.
>
>Charles Wortz
>Software Development Division
>
>-----Original Message-----
>From: accessd-bounces at databaseadvisors.com
>[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of David Fenton
>Sent: Wednesday, July 23, 2003 8:11 AM
>To: accessd at databaseadvisors.com
>Subject: [AccessD] Displaying TAB as [Chr(9)] in a text control
>
>Does anyone know what to do about the little square that appears when using
>TAB (ASCII 9) in a textbox on a report? If I direct the report to a RTF
>document the tab translates perfectly to a TAB as it is supposed to, but it
>will not do it on the report in its natural form. Below is the code I am
>using in the text control.
>
>="Student No:" & Chr(9) & [StudID] & Chr(13) & Chr(10) & "Course: " &
>Chr(9) & IIf([CourseName] Is Null,[CRICOS_name],[CourseName])
>
>Cheers
>David Ô¿Ô
>Australia



More information about the AccessD mailing list