A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditional format -- other fields including border



 
 
Thread Tools Display Modes
  #1  
Old August 3rd, 2007, 08:08 PM posted to microsoft.public.access.reports
Eric_G
external usenet poster
 
Posts: 34
Default 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  
Old August 3rd, 2007, 08:57 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default 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  
Old August 3rd, 2007, 09:32 PM posted to microsoft.public.access.reports
Eric_G
external usenet poster
 
Posts: 34
Default 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  
Old August 3rd, 2007, 09:40 PM posted to microsoft.public.access.reports
Eric_G
external usenet poster
 
Posts: 34
Default 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  
Old August 3rd, 2007, 11:59 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.