Results 1 to 15 of 15
  1. #1
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    644

    Text box gone crazy with Long Text and rich text

    I don't know if the rich text has anything to do with the problem,


    but I got down to doing helps for the forms.
    I'm using another form to display validation error messages (from a prior thread) and the helps.
    For an hour I beat my head against the wall trying to figure how to get the scroll bar to show for a large help.
    Then after changing the form and changing its size with an anchored textbox...

    Click image for larger version. 

Name:	221204ScrBar1.jpg 
Views:	21 
Size:	179.4 KB 
ID:	49251

    I can see all the text.
    But if I shrink the vertical size, you can see that we're in the middle of the same text without a scroll bar.

    Click image for larger version. 

Name:	221204ScrBar2.jpg 
Views:	20 
Size:	231.6 KB 
ID:	49252

    Now, shrink a bit more and a scroll bar appears but using it won't show all the text.

    Click image for larger version. 

Name:	221204ScrBar3.jpg 
Views:	20 
Size:	239.7 KB 
ID:	49253

    Has anyone seen documentation that put's a limitation on textbox size or is this a possible bug?
    Got a better idea than using a textbox?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,795
    The scroll bar shown has nothing to do with scrolling within the textbox - it is the form's scrollbar. A textbox vertical scrollbar doesn't show until the textbox has focus. Also, AFAIK, textbox scrollbar does not work with mouse wheel.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    644
    Quote Originally Posted by June7 View Post
    The scroll bar shown has nothing to do with scrolling within the textbox ....
    Yep, it got me on that one. Still, I see no way to make the textbox scroll, even though the property is turned on.
    More dents in the wall.
    Click image for larger version. 

Name:	221204ScrBar4.jpg 
Views:	22 
Size:	164.6 KB 
ID:	49254
    But, I'll go back and see how I can get the textbox to have focus and see what happens.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,795
    Put focus on textbox (tab or click into). Does the vertical scrollbar show?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    644
    Okay, so setting enabled to yes on the data tab fixed that problem.
    But created a new one.
    I have different background colors based on what is going on.
    The textbox is supposed to be transparent,
    but when it gets focus, it changes from transparent to the last color in the form design, which isn't the color I want.
    Now I suppose I have to go set all the background colors for each call to the form?
    It never ends with Access, if I choose transparent, I don't want it changed!

    Thanks June7 for pointing me in the correct direction.

  6. #6
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    644

    Two scroll bars

    First I couldn't get any scrollbars, now I get two!


    Click image for larger version. 

Name:	221204ScrBar5.jpg 
Views:	22 
Size:	173.8 KB 
ID:	49256
    Last edited by twgonder; 12-05-2022 at 04:15 AM.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,795
    Your attachment won't open.

    A transparent textbox will certainly show form's color. However, the form color should show through transparent textbox even when textbox doesn't have focus.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,387
    Also, AFAIK, textbox scrollbar does not work with mouse wheel.
    you can make it work with API's

    put this in a new module (if you want to use this all over the place)
    Code:
    Option Compare Database
    Option Explicit
    
    
    'Scrolling Constants
    Private Const WM_VSCROLL = &H115
    Private Const WM_HSCROLL = &H114
    Private Const SB_LINEUP = 0
    Private Const SB_LINEDOWN = 1
    
    Private Declare PtrSafe Function GetFocus Lib "USER32" () As LongPtr
    Private Declare PtrSafe Function SendMessage Lib "USER32" Alias "SendMessageA" (ByVal hWnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, lParam As Any) As LongPtr
    
    
    
    
    Function useMouseWheel(wCount As Long)
    Dim i  As Long
    
        For i = 1 To Abs(wCount)
        
            SendMessage GetFocus, WM_VSCROLL, IIf(wCount < 0, SB_LINEUP, SB_LINEDOWN), 0&
        
        Next
    
    End Function
    and put this in the form mousewheel event
    Code:
    Private Sub Form_MouseWheel(ByVal Page As Boolean, ByVal Count As Long)  
    
         If ActiveControl.Name = "name of the textbox you want to scroll" Then useMouseWheel (Count)
    
    End Sub

  9. #9
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    644

    Not transparent when has focus

    Quote Originally Posted by June7 View Post
    Your attachment won't open.

    A transparent textbox will certainly show form's color. However, the form color should show through transparent textbox even when textbox doesn't have focus.
    Okey, I put the image back in again, should be there.
    The textbox changes to a color (different from the detail section's color) from transparent when I click on it to get focus. It's transparent before the click.

    I have an HP laptop, with HP wireless mouse, Windows 10 and Office 2021. My textbox, when in focus and with a scrollbar has the mouse wheel working without doing anything special.

    Without focus:
    Click image for larger version. 

Name:	221204ScrBar6.jpg 
Views:	23 
Size:	95.9 KB 
ID:	49257

    With focus:
    Click image for larger version. 

Name:	221204ScrBar7.jpg 
Views:	24 
Size:	66.0 KB 
ID:	49258

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,702
    A transparent tb takes on a shade or colour property based on what the form colour is when the tb receives focus. If you don't like that, remove the form colour or set it to background1 (theme colour) or look at tb properties are for back colors in the link below. These are not in the property sheet. They start after back color in the left list. There are fore colour properties there that are also not in the property sheet.

    https://learn.microsoft.com/en-us/of...tbox.backshade
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,795
    Yes, textbox becomes opaque when it gets focus. In my form that is white regardless of color of the section textbox is in.

    I cannot replicate the two scroll bars shown in your image.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    twgonder is offline Expert
    Windows 10 Access 2016
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    644

    Not on my version of Access

    Quote Originally Posted by Micron View Post
    A transparent tb takes on a shade or colour property based on what the form colour is when the tb receives focus...
    I wanted the textbox to be transparent, as can be seen in the first example in my post #9. The second example shows that the textbox got a color when it got focus by a mouse click. I don't think I need shading.

  13. #13
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,702
    I wanted the textbox to be transparent, as can be seen in the first example in my post #9.
    I wrote about a transparent textbox so why did you think you needed to point that out?

    first pic: design view - clearly transparent
    Click image for larger version. 

Name:	1tbA.jpg 
Views:	12 
Size:	10.7 KB 
ID:	49261

    2nd pic: cursor is in tb, so it definitely has the focus. No shading of any kind.
    Click image for larger version. 

Name:	1tbB.jpg 
Views:	12 
Size:	1.8 KB 
ID:	49262

    Keep playing until you get what you want, I guess.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,795
    Maybe something changed after 2016 because with Access 2010 I cannot get Micron's result, even with those same settings. When textbox gets focus it goes from transparent to opaque white. No idea why you get yellow.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,702
    All I can do is play with a sample db I guess, and see if I can come up with something. I don't think it has to be the full db - just enough to prevent the form from raising errors when opened.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 8
    Last Post: 06-18-2021, 04:22 PM
  2. Rich text field not displaying rich text properly
    By CodeLiftSleep in forum Access
    Replies: 4
    Last Post: 01-24-2018, 10:59 AM
  3. Replies: 3
    Last Post: 06-04-2017, 01:02 PM
  4. Replies: 4
    Last Post: 08-07-2015, 07:49 AM
  5. Replies: 1
    Last Post: 05-24-2012, 04:59 AM

Tags for this Thread

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