Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can I use Tabs in Text Box? (A2k (9.0.3821) SR-1)

    I have the following report module code that fills in a report text box paragraph1 OK:

    Paragraph1 = _
    "On " & _
    Format(Forms(gloGetValue("ParentFormName")).[dtmReceiveDate], "mmmm d"", ""yyyy") & _
    ", you reported the property: " _
    & vbCr + vbLf + vbCr + vbLf & _
    "Tax Map#: " & _
    Forms(gloGetValue("ParentFormName")).strSBLNo _
    & vbCr + vbLf & _
    "Location: " & _
    Forms(gloGetValue("ParentFormName")).[strCRLocation] _
    & vbCr + vbLf & _
    "Owner Name: " & _
    Forms(gloGetValue("ParentFormName")).[strOwnerName2] _
    & vbCr + vbLf & _
    "Address: " & _
    Forms(gloGetValue("ParentFormName")).[strOwnerAddress] _
    & vbCr + vbLf & _
    "City St Zip: " & _
    Forms(gloGetValue("ParentFormName")).[strOwnerCityStZip] _
    & vbCr + vbLf + vbCr + vbLf & _
    " had the following violation(s): " _
    & vbCr + vbLf + vbCr + vbLf

    It returns the following:

    Tax Map#: 111-222-333
    Location: 123 Main St
    Owner Name: Joe Blow
    Address: 123 Main St
    City St Zip: Buffalo, NY 14092

    Are there tab commands I can put in the above code so the left margin of the data lines up say with the Owner Name?

    Thanks, John

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can I use Tabs in Text Box? (A2k (9.0.3821) SR-1)

    If you add vTab to your string that may work. You will have to do some trial and error testing to get everything lined up.

    A couple of other things I noticed:

    You are using vbCr + vbLF. You can vbCrLf as a single entity to shorten your code.

    Don't use + to concatenate strings. Use an &. If you use a + when dealing with numeric string, you may get unintended results like actual addition of the values of the strings instead of concatenation of the string.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can I use Tabs in Text Box? (A2k (9.0.3821) SR-1)

    Hi Bryan

    vbTab or Chr(9) only generated a little square in front of the data field. Both on preview and print.

    Any other thoughts?

    John

  4. #4
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can I use Tabs in Text Box? (A2k (9.0.3821) SR-1)

    A couple of other ideas come to mind.

    Pad with spaces. It will take some work if you are using a proportional font (Arial, TNR), but it would be fairly simple if you are using a fixed with font (such as courier)

    You could also break it into a series of text boxes and labels. The labels for the static info, and individual text boxes for the data.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Can I use Tabs in Text Box? (A2k (9.0.3821) SR-1)

    Trap the keydown and insert 5 spaces when the key is vbKeyTab. Take a look at the attached sample database. I used that technique in frmNotes to simulate tabs.
    Attached Files Attached Files
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •