Results 1 to 6 of 6
  1. #1
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150

    MS Access - TAB SPACE in Unbound textbox

    Hi,



    So, i'm asking if a tab space is possible in an unbound textbox (Rich Text type)? I could code something to add spaces, but would prefer a more legitimate solution.

    P.S. i notice tabs don't work in this forum's textbox



    Thanks

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    From what I've read on the subject, no. Some will key in a special character then replace it in form with the desired spacing or whatever it is they're after. The problem as I see it is, in a bona fide word processor, tab key functions so as to move to the next "tab". There may only be 2 or 3 spaces left, so the effect is random. Surely you only want to inject a set number of spaces...
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150
    Quote Originally Posted by Micron View Post
    From what I've read on the subject, no. Some will key in a special character then replace it in form with the desired spacing or whatever it is they're after. The problem as I see it is, in a bona fide word processor, tab key functions so as to move to the next "tab". There may only be 2 or 3 spaces left, so the effect is random. Surely you only want to inject a set number of spaces...

    Hi Micron!

    Yes i was hoping to not have to use this alternative. I guess with enough coding you could maybe write something to act as if there were tab stops so it did in fact function as a tab, rather than just a set number of spaces.

    Not sure if I want to spend this development time or not! Maybe ill get bored though and try it .

    Thanks for your 2 cents, ill keep the thread going for a bit to see if anyone else has a working solution.

    Regards

  4. #4
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    rich text does not use tab characters but formatting codes

    see this link for testing to see what codes are required and where they are placed for different formatting effects

    https://www.access-programmers.co.uk...d.php?t=290820

  5. #5
    ironfelix717 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    150
    UPDATE:

    This problem came up again tonight. To simply add a tab in an unbound Rich Text formatted textbox, use the following approach:

    - Set tab stop property of textbox to 'No'

    Use the following code:

    Code:
    Private Sub tbSetup_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyTab Then
        KeyCode = 0
        SendKeys String(8, " ")  ' 8 = number of spaces to 'tab'
    End If

    Note: this obviously doesn't insert an actual tab, but simulates adding spaces with the tab key, which is good enough for my needs.

  6. #6
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    I seem to remember seeing and using a simple Space(x) (nothing to do with the rockets) function that inserted x number of spaces in a string.

    https://docs.microsoft.com/en-us/off...space-function

    I thought it was something someone had written but it's inbuilt.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 10-06-2017, 06:22 PM
  2. Sum in unbound textbox
    By adeebarsad in forum Access
    Replies: 9
    Last Post: 03-22-2017, 09:01 AM
  3. Replies: 3
    Last Post: 04-04-2016, 09:21 AM
  4. unbound textbox to bound textbox
    By thescottsman92 in forum Access
    Replies: 3
    Last Post: 08-29-2013, 02:02 AM
  5. Replies: 8
    Last Post: 04-12-2013, 08:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums