[AccessD] Highlight field being edited in a continuous form - in 9 simple steps.

Scott Marcus marcus at tsstech.com
Thu May 20 08:16:09 CDT 2004


Thanks to all those who helped me figure this out(you know who you are). I can now highlight individual fields, that have the focus, on a continuous form.

It required the following (clean up tweaks not included):

1) set the Back Style of each highlighted field to "Transparent". (I didn't do this because I'm only highlighting check boxes).

2) create form level public global Boolean variables for each highlighted field

3) create an unbound textbox to hold the current value of the key for the selected record

4) create an unbound textbox behind each field to show the highlighting

5) set the Font of the unbound highlighting textbox to "Terminal"

6) set the Fore Color of the unbound highlighting textbox to the color you want for highlighting

7) set the Control Source for each highlighting textbox to the following (replacing field, form and control names with the appropriate values):
         "=IIf([key_field]=[Forms]![frmYour_Form_Name]![txtUnbound_Textbox]
          And [bolBooleanVariable]=True,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ",Null)"

8) add 2 lines of code per field in the Got Focus and Lost Focus events
a) in the Got Focus event, set the Boolean variable to true
b) in the Lost Focus event, set the Boolean variable to false
c) in both events, requery the highlight textbox for the given control

9) add 1 line of code to set the unbound textbox to the key of the current record in the Forms Current event
     
********************
Hopefully I didn't miss anything. Please keep the following in mind:

1) This is just a quick synopsis of what I did.

2) The highlighting on my form actually takes place on a sub form.

3) The unbound textbox that holds the key field value is on the parent form.

4) I developed this to highlight checkboxes and have not tested it with other controls. It should still work the same.

Scott Marcus
TSS Technologies, Inc.
marcus at tsstech.com
(513) 772-7000






More information about the AccessD mailing list