Required field colour indication

  • Thread starter Thread starter faapa via AccessMonster.com
  • Start date Start date
F

faapa via AccessMonster.com

Hi

Im not sure if this can be done but, i've got a form with many fields
(textboxes and combos) if a user begins to complete one textbox - i want 6
other textboxes to 1) change colour indicating that they must be filled in)
and 2) have a msg box appear if any of the 6 boxes is not complete) The
reason for this is becasue not all forms need to be completed to save info on
the form...is this possible?
 
1) Create six copies of the original trigger textbox without the label.make
them the same size as the 6 textboxes that you want to highlight. Set the
background of the ones you want filled in to transparent. Edit the
conditional format of the highlight boxes. Leave the Default background
color and change the font color to the same. Make the Condition to Field
value is Greater that " ". Change the background and font color to whatever
highlight color you want. I would advise a pastel that will contrast with
your font color. Red is bad!
You will probably have to Delete and Paste each of the 6 fill in text boxes
so that they will be in the foreground of your hghlight boxes. Move the
highlight boxes directly behind each of the fill in boxes once you have them
placed on your form.
2) You could create a close form button and place code ahead of the actual
close form command that checks to see if the trigger box has anything in it
and, if it does, then checks to see if the other six boxes have anything in
them and if they don't, open a MsgBox with your message.
Someone else may have a better way of checking but I would use something like
this:
If Me!Trigger_Box_Name > " " then
If Me!Fill_In_Box1 < " " then Goto OpenMessage
If Me!Fill_In_Box2 < " " then Goto OpenMessage
etc.
End If
DoCmd.Close
OpenMessage:
MsgBox "You must fill in ...."

Hope this helps,
Bob
 
Back
Top