Forms question

jnh

Registered User.
Local time
Today, 13:09
Joined
Jan 2, 2012
Messages
31
Pretty new at this game and still have many ??? but for right now can anybody help me with:

...Have disabled a couple of fields in a form. Would like to change the
Background color to something else instead of that 'Grey" given

...When Validating a field (via a sub routine) I would like to remove
keyed data in field if validation fails. Access returns properly to error field
(setfocus) but data previously keyed is still there.

Thanks for your help...jnh
 
...Have disabled a couple of fields in a form. Would like to change the
Background color to something else instead of that 'Grey" given
Set the Locked property to Yes and the Enabled property to No. Then change the BackColor to whichever colour you wish. Or do you actually want to make the entire form read-only?

...When Validating a field (via a sub routine) I would like to remove
keyed data in field if validation fails. Access returns properly to error field
(setfocus) but data previously keyed is still there.
Use the Before Update event of the Form and if the validation fails, set the Cancel argument of this Sub to True.
 
The Color fix is in - Thank you


Believe I had done what you suggested (see sub routine below) but it will not clear keyed data (must be doing something wrong).

Also how do I OFFICIALLY express my thanks ?

Private Sub Score2H_BeforeUpdate(Cancel As Integer)
If Val(Score2H) > 11 Then
MsgBox "Max value 11"
Me.Score2H.Enabled = True
MyFlag = True
Cancel = True
Else
MyFlag = False
End If
End Sub


jnh
 
No problemo! There's the Scales at the top of the helper's post and there's the Thanks button at the bottom of the helper's post too.

I'm guessing these controls are not bound to any field?
 
There are tied to a Control Source (Table).
 
Must be getting late - Don't seem to find

There's the Scales at the top of the helper's post
 

Users who are viewing this thread

Back
Top Bottom