If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Conditional format -- other fields including border
I'm attempting to add a conditional format so that the "border" becomes
transparent if the value of a text boxis equal to "Y". If the value is other than "Y", then I want the border to show up. I've attempted this code to no avail: 'Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) ' IIf(IsNull(Me.Tickbox),Me.BorderStyle.Tickbox = "0", me.borderstyle.tickbox = "2") 'End Sub Any suggestions? |
#2
|
|||
|
|||
Conditional format -- other fields including border
On Fri, 3 Aug 2007 12:08:03 -0700, Eric_G wrote:
I'm attempting to add a conditional format so that the "border" becomes transparent if the value of a text boxis equal to "Y". If the value is other than "Y", then I want the border to show up. I've attempted this code to no avail: 'Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) ' IIf(IsNull(Me.Tickbox),Me.BorderStyle.Tickbox = "0", me.borderstyle.tickbox = "2") 'End Sub Any suggestions? Change the border of a text control or label control? Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.[SomeField] = "Y" Then Me.[CongtrolName].BorderStyle = 0 ' transparent Else Me.[ControlName].BorderStyle = 2 ' dashes End If End Sub The above assumes the datatype of [SomeField] is text. Note: If you are trying to change the borderstyle of a check box, you can't. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
Conditional format -- other fields including border
thank you, Fred, it appears to be working, but sporadically.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.[Tickbox] = "Y" Then Me.[Tickbox].BorderStyle = 0 ' transparent Else Me.[Tickbox].BorderStyle = 1 ' solid End If End Sub ___ Is it possible that the "controlname" as noted in the 2nd and 3rd references above should not be the name I gave the text box in its "text box name field"? Should I be using the text "controlname" literally? The problem seems to be that "fredg" wrote: On Fri, 3 Aug 2007 12:08:03 -0700, Eric_G wrote: I'm attempting to add a conditional format so that the "border" becomes transparent if the value of a text boxis equal to "Y". If the value is other than "Y", then I want the border to show up. I've attempted this code to no avail: 'Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) ' IIf(IsNull(Me.Tickbox),Me.BorderStyle.Tickbox = "0", me.borderstyle.tickbox = "2") 'End Sub Any suggestions? Change the border of a text control or label control? Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.[SomeField] = "Y" Then Me.[CongtrolName].BorderStyle = 0 ' transparent Else Me.[ControlName].BorderStyle = 2 ' dashes End If End Sub The above assumes the datatype of [SomeField] is text. Note: If you are trying to change the borderstyle of a check box, you can't. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#4
|
|||
|
|||
Conditional format -- other fields including border
Does the field need to be "cleared" for the next record?
"fredg" wrote: On Fri, 3 Aug 2007 12:08:03 -0700, Eric_G wrote: I'm attempting to add a conditional format so that the "border" becomes transparent if the value of a text boxis equal to "Y". If the value is other than "Y", then I want the border to show up. I've attempted this code to no avail: 'Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) ' IIf(IsNull(Me.Tickbox),Me.BorderStyle.Tickbox = "0", me.borderstyle.tickbox = "2") 'End Sub Any suggestions? Change the border of a text control or label control? Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.[SomeField] = "Y" Then Me.[CongtrolName].BorderStyle = 0 ' transparent Else Me.[ControlName].BorderStyle = 2 ' dashes End If End Sub The above assumes the datatype of [SomeField] is text. Note: If you are trying to change the borderstyle of a check box, you can't. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#5
|
|||
|
|||
Conditional format -- other fields including border
On Fri, 3 Aug 2007 13:32:26 -0700, Eric_G wrote:
thank you, Fred, it appears to be working, but sporadically. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.[Tickbox] = "Y" Then Me.[Tickbox].BorderStyle = 0 ' transparent Else Me.[Tickbox].BorderStyle = 1 ' solid End If End Sub ___ Is it possible that the "controlname" as noted in the 2nd and 3rd references above should not be the name I gave the text box in its "text box name field"? Should I be using the text "controlname" literally? The problem seems to be that "fredg" wrote: On Fri, 3 Aug 2007 12:08:03 -0700, Eric_G wrote: I'm attempting to add a conditional format so that the "border" becomes transparent if the value of a text boxis equal to "Y". If the value is other than "Y", then I want the border to show up. I've attempted this code to no avail: 'Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) ' IIf(IsNull(Me.Tickbox),Me.BorderStyle.Tickbox = "0", me.borderstyle.tickbox = "2") 'End Sub Any suggestions? Change the border of a text control or label control? Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If Me.[SomeField] = "Y" Then Me.[CongtrolName].BorderStyle = 0 ' transparent Else Me.[ControlName].BorderStyle = 2 ' dashes End If End Sub The above assumes the datatype of [SomeField] is text. Note: If you are trying to change the borderstyle of a check box, you can't. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail Change [ControlName] to the actual name of the control, so [TickBox] is correct. The code assumes that [TickBox] is a Text datatype control, and that the value "Y" is a text value. It works fine for me. If this still creates a problem, your difficulty is elsewhere. Perhaps the actual value in the field is not a "Y" but a lookup number? In that case change the code to If [TickBox] = n Then where n is the actual lookup number that "Y" represents. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
Thread Tools | |
Display Modes | |
|
|