469,645 Members | 1,941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

hide unchecked checkboxes on a report

I have a report on which each record could potentially display three checkboxes...call them chk1, chk2, chk3. To minimize clutter on the page, I only want to display the labels of the checkboxes that are checked. I have not been able to find any way to test the value of these checkboxes using any of the report events. Access's conditional formatting doesn't allow you to hide a control based on conditions. Any ideas? Thanks!
Aug 5 '08 #1
1 2799
3,532 Expert 2GB
Actually, you can hide a control using Conditional Formatting, you just have to be tricky and change the Fore color if the condition is met! But you can't use CF for anything with checkboxes, so you need to be tricky again. There may be a slicker way to do this, but this will work!

First off, create a small rectangle and place it over each checkbox. Name them chk1Cover, chk2Cover and chk3Cover. Set their Border Style to Transparent. Now place this code behind your report:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
  2.  If Me.chk1 = 0 Then
  3.   Me.chk1Cover.Visible = True
  4.  Else
  5.   Me.chk1Cover.Visible = False
  6.  End If
  8. If Me.chk2 = 0 Then
  9.   Me.chk2Cover.Visible = True
  10.  Else
  11.   Me.chk2Cover.Visible = False
  12.  End If
  14. If Me.chk3 = 0 Then
  15.   Me.chk3Cover.Visible = True
  16.  Else
  17.   Me.chk3Cover.Visible = False
  18.  End If
  20.  End Sub
Linq ;0)>
Aug 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Terence Parker | last post: by
2 posts views Thread by TGEAR | last post: by
10 posts views Thread by k3pp0 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.