Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2004
    Posts
    145

    Unanswered: Textbox - Need to know when to scroll

    Hello,
    I'm using Access 2003, WinXP SP2. In our DB we have an "info" textbox that is scrollable vertically. Say the textbox has 6 lines of text but only 4 are visible without scrolling. In our DB the scroll bars don't appear until you click the text box. So if the user is just browsing they probably aren't going to click the actual info textbox. So they might not notice there are 6 lines of text because they will only see the 4 lines and no scrollbar. My question is - is there a way to test to see if the textbox has text beyond what is being displayed? If so I could turn the background a different color or something to alert the user there is more info to be seen.
    A little more info on the program - The user is presented with a form that contains member info. They type in a member number and the fields are displayed. The fields are initially locked until the user clicks edit and then they become editable. I'm not sure if this has any effect on the scrollbar appearing.

    Thanks in advance.
    GG
    Code:
    On Error Goto Hell
    
    Hell:
        Msgbox("An error occurred, but was sent to Hell. You may continue.")

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you may be able to force the scroll bars to appear if you set the focus of the form to that control

    .. probably need to insert the call in the forms on current event

    <mytextboxcontolname>.setfocus
    mind you I suspect ther users are going to get pished if thats where the focus always ends... perhaps you could trick access by setting it to that control then the first control on the form.. it may require a slight delay between each set focus to work.

    ...no idea if that will do the trick, but its worht a try in the absebce of a better idea

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Regarding changing the background color you can use Conditional Formatting and set it up so if there is no text, one background color is displayed verses another where there is text.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Jan 2004
    Posts
    145
    healdem - The scrollbars disappear when the focus is lost so I would have to keep it on that control, but you are right in that it won't fly with the users. Also I noticed the scrollbars appear whether scrolling is needed or not so it really doesn't matter.

    pkstormy - Thanks for the tip but I only need the color to change if the text goes beyond the limits of the textbox.

    Thanks for the replies.
    GG
    Code:
    On Error Goto Hell
    
    Hell:
        Msgbox("An error occurred, but was sent to Hell. You may continue.")

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    In the Conditional Formatting, you can use an expression (ie. Len(me!MyField) > 200) to specify what background color to show if there are XX characters which require use of the scrollbars (if that helps).
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Jan 2004
    Posts
    145
    That sounds like it will work since I'm using a non-proportional font. Might have to tweak the textbox size but that won't be a big deal. Thank you.
    GG
    Code:
    On Error Goto Hell
    
    Hell:
        Msgbox("An error occurred, but was sent to Hell. You may continue.")

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Personally I'd make it do something like this
    Code:
    Line 1
    Line 2
    Line 3
    Line 4 ...
    Check on change if the length is greater than the 4 lines, then on focus reload the record (or remove the added ...)
    George
    Home | Blog

Posting Permissions

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