Hi Everyone,
I’m new here and also just beginning to learn VBA.
I’m setting up a new database. The main form (which is bound to a table) has a lot of controls for staff to enter info into. For reasons I won’t go into I have set every control with a green background which goes white if text is entered:
My question:
Is there a way of scripting this economically, without having to repeat the above code for every control in the form (upwards of 100). I have browsed several books but cannot find anything that helps with this.
At present the form works fine until I start entering text into memo fields (about a dozen of these). If I type in more than four words then try to save or open a new record I repeatedly get the message, “Not a valid bookmark” or 'You can't go to the specified record".
I have checked all my current coding, nothing is amiss so maybe I need more RAM? On another form I am getting an ‘Out of memory message’.
Would appreciate any help as I’m completely stuck.
I’m new here and also just beginning to learn VBA.
I’m setting up a new database. The main form (which is bound to a table) has a lot of controls for staff to enter info into. For reasons I won’t go into I have set every control with a green background which goes white if text is entered:
Code:
Private Sub txtName_LostFocus()
If IsNull(Me.txtName.Value) Then
Me.txtName.BackColor = RGB(0, 255, 128)
Else
Me.txtName.BackColor = RGB(255, 255, 255)
End If
End Sub
Is there a way of scripting this economically, without having to repeat the above code for every control in the form (upwards of 100). I have browsed several books but cannot find anything that helps with this.
At present the form works fine until I start entering text into memo fields (about a dozen of these). If I type in more than four words then try to save or open a new record I repeatedly get the message, “Not a valid bookmark” or 'You can't go to the specified record".
I have checked all my current coding, nothing is amiss so maybe I need more RAM? On another form I am getting an ‘Out of memory message’.
Would appreciate any help as I’m completely stuck.
Comment