Scott Marcus
marcus at tsstech.com
Thu May 20 14:40:57 CDT 2004
It's the same method I've used before. It's been so long since I've used it. I knew that I wanted something less intensive than that. Scott Marcus TSS Technologies, Inc. marcus at tsstech.com (513) 772-7000 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Thursday, May 20, 2004 3:18 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Highlight field being edited in a continuous form-in9simple steps. Scott, <<Does this method involve adding a field to the record?>> You can, but I avoid that approach as it doesn't work then in a multi-user setting. The basic setup is that you use an OLE bound control behind the other controls. I usually setup the source for that as a bitmap field with images that are 16 x 16 pixels and stretched in the control. The images are kept in a color table, so a linking table is required (PK from main table and Color ID to display). I've also heard of folks that load the bitmaps into a variable at startup, and set the control source to a function that returns the bitmap, but I've never needed that kind of speed. I've found this approach to be a bit more flexible then the others, but I don't think I would say that its "better" then others. Just a different way of doing things. Jim Dettman President, Online Computer Services of WNY, Inc. (315) 699-3443 jimdettman at earthlink.net -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Scott Marcus Sent: Thursday, May 20, 2004 3:06 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Highlight field being edited in a continuous form -in9simple steps. Does this method involve adding a field to the record? If so, I've done that before. I just wanted something quick and dirty<g>. But hey, send it to me anyway. Maybe your method is better than mine. Scott Marcus TSS Technologies, Inc. marcus at tsstech.com (513) 772-7000 -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman Sent: Thursday, May 20, 2004 2:57 PM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Highlight field being edited in a continuous form - in9simple steps. Scott, Well now that you've finished all that<g>, I have a sample MDB which has a slightly different method of coloring rows (or individual controls if you want), which is slightly more flexible. Your not stuck with just colors either, but can display graphics as well. Also, since it's not based on using Format or the terminal font, you can do anything you want for fonts. If you'd like to see it drop me an e-mail *off* list. Jim Dettman President, Online Computer Services of WNY, Inc. (315) 699-3443 jimdettman at earthlink.net -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Scott Marcus Sent: Thursday, May 20, 2004 9:16 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] Highlight field being edited in a continuous form - in9 simple steps. 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 -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com