Change textbox color on form in Access 2013 for dyslexic user

papic1972

Registered User.
Local time
Today, 20:46
Joined
Apr 14, 2004
Messages
122
Hi all,

I have a new staff member in my office that has informed me that she has a degree of dyslexia. To assist her I've trialled changing the textboxes on one form in my Access 2013 application to a light pink color & this has instantly helped her to read/input text.
Is there a way to automatically change each textbox to light pink on every form in my application on startup based on user login (say using an IIF statement in the OnLoad event of the startup form). Any help would be greatly appreciated, thanks!
 
OK, i could probably approach this a different way. Does anyone know of way I could augment this OnLoad code to work as a VBA Module and then call it by placing ColorChangeJW in the OnLoad event of each form in my application?

Function ColorChangeJW()
Dim tb As Control

If fOSUserName() = "jessica" Then
For Each tb In Me.Controls
If TypeOf tb Is TextBox Or TypeOf tb Is ComboBox Or TypeOf tb Is ListBox Then
tb.BackColor = 14399487
End If
Next
End If

End Function

The problem I have is Me.Controls..... how would I reference the current form, Me.Controls gives me an error.
 
Pass a form reference to the procedure, like . . .
Code:
Sub ColorChangeJW([COLOR="Red"][B]frm [/B][/COLOR]as Access.Form)
   Dim tb As Control

   If fOSUserName() = "jessica" Then
      For Each tb In [B][COLOR="Red"]frm[/COLOR][/B].Controls
         If TypeOf tb Is TextBox Or TypeOf tb Is ComboBox Or TypeOf tb Is ListBox Then
            tb.BackColor = 14399487
         End If
      Next
   End If

End Sub
. . . and then in any form's OnLoad event handler . . .
Code:
Private Sub Form_Load()
    ColorChangeJW Me
End Sub

Makes sense?
 
Hi Mark, yes that makes perfect & total sense to me!!! Thanks heaps, works perfectly!
Cheers!
 

Users who are viewing this thread

Back
Top Bottom