Prev: Professional manufacturing WEB of sites for firms and organizations. WEB-design
Next: Dynamic Reporting System
From: blake7 on 17 May 2010 08:02 Hi All, I have the following code which is not working wherever I put it, can someone help, the processed field is a yes / no selection from a table containing yes / no value, the duedate field is formatted to a long date. - or can this be done in conditional format with an expression? Thanks If me.Processed="yes" then me.Duedate.backcolor=vbblue else me.Duedate.backcolor=vbred end if
From: Arvin Meyer [MVP] on 17 May 2010 08:09 The code needs to be in the AfterUpdate event of the Processed checkbox or textbox, and in the form's Current event. If it is a continuous form you must use Conditional Formatting. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "blake7" <blake7(a)discussions.microsoft.com> wrote in message news:3913085C-6079-4080-95B0-4FA00A751C3E(a)microsoft.com... > Hi All, I have the following code which is not working wherever I put it, > can > someone help, the processed field is a yes / no selection from a table > containing yes / no value, the duedate field is formatted to a long > date. - > or can this be done in conditional format with an expression? > Thanks > > If me.Processed="yes" then > me.Duedate.backcolor=vbblue > else > me.Duedate.backcolor=vbred > end if
From: Dirk Goldgar on 17 May 2010 11:21
"blake7" <blake7(a)discussions.microsoft.com> wrote in message news:3913085C-6079-4080-95B0-4FA00A751C3E(a)microsoft.com... > Hi All, I have the following code which is not working wherever I put it, > can > someone help, the processed field is a yes / no selection from a table > containing yes / no value, the duedate field is formatted to a long > date. - > or can this be done in conditional format with an expression? > Thanks > > If me.Processed="yes" then > me.Duedate.backcolor=vbblue > else > me.Duedate.backcolor=vbred > end if A yes/no field will never equal the string "yes". These are boolean (true/false) fields that have a value of -1 or 0 (or, in some cases, 1 or 0), which is interpreted as True or False. Essentially, any non-zero value is interpreted as True, while zero is interpreted as False. In your code, use: If Me.Processed = True Then or: If Me.Processed <> 0 Then or: If (Me.Processed) Then -- Dirk Goldgar, MS Access MVP Access tips: www.datagnostics.com/tips.html (please reply to the newsgroup) |