Results 1 to 8 of 8
  1. #1
    halfaguava is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    5

    Replace checkboxes with Icons

    Hello, I have the following form layout:





    How would I go about replacing the checkboxes with Icons. If the tickbox is TRUE, display its Icon, if false, display nothing. This would turn a sea of ticks into associated icons... here is a mock up of what I would like:



    You can see the for both buildings the office box was checked and therefore they get an office icon.

    Many Thanks,

    Halfaguava

  2. #2
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    You can do this:

    Code:
    Private Sub CheckBox1_Click()
    If me.CheckBox1.value=-1 then
       me.Icon1.Visible=True
    Else
       me.Icon1.Visible=False
    End If
    Where CheckBox1 and Icon1 will be the names of your checkbox and Icon on the form respectively.

    hth.

  3. #3
    halfaguava is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    5
    Thank you.

    I tried this using the 'After Update' event rather than 'Click' and It did not work. You solution seems like it should work though! Any other suggestions?

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    It will not work with a form in Continuous View or Datasheet view. It will only work for SINGLE FORM VIEW. Otherwise it will change all of them down the line.

    Also, did you actually place the icons on the form and set their visibile property to NO so that Khalid's code would work? If the icon isn't on the form, then it isn't going to display.

    Oh, and I can't see your pics (should have uploaded them here instead) as public image sharing sites (like imageshack) are blocked by my workplace.

  5. #5
    khalid's Avatar
    khalid is offline MS-Access Developer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2010
    Location
    Kuwait
    Posts
    244
    Yeah, bob is right. I just saw the pictures of your form (its continues form) you might not uploaded before?

    Try to call the code on:
    On Form current Event, make all the icons invisible on the form.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Do you want to allow user to be able to uncheck the boxes? What are these icons - image controls?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    halfaguava is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    5
    Hello, apologies for late response I have been away and apologies for those who cannot view the images. (How do I upload here?)

    I used khalid's suggestion of 'On Current' event and I'm sure you are right, it wont work with a continuous form because the image will only respond the the first records checkbox, it ignores the subsequent values.

    @June7 - the user can open the record in full and emend the check box values. Office, Retail Residential, Hotel etc. depending on the type of Building. It would then be nice, in this compact list view to see the icons (visible, or hidden) rather than a sea of checkbox's.

    Its hard to explain!

  8. #8
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by halfaguava View Post
    (How do I upload here?)
    When posting on a thread, either you will be in advanced editing mode or not. You will know you are if you see the first view below. And if you are on the quick editing, you are on the second view below. Click on Go Advanced, if you are not on the Advanced view. Then click MANAGE ATTACHMENTS and then select the pic(s) you want and click the UPLOAD BUTTON after selecting them. That will upload them to the site. You will know you have done so when you get the blue links showing. See the third pic below.

    PIC #1




    PIC #2







    PIC #3


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Reports and Checkboxes
    By seah0rse in forum Access
    Replies: 1
    Last Post: 06-07-2011, 03:37 AM
  2. Desktop Icons
    By Neil Bingham in forum Access
    Replies: 1
    Last Post: 05-12-2011, 10:29 AM
  3. Clear all checkboxes?
    By thekruser in forum Forms
    Replies: 2
    Last Post: 09-16-2010, 09:50 AM
  4. Button Icons and MSG Box Icons
    By Mclaren in forum Programming
    Replies: 6
    Last Post: 06-22-2010, 11:34 AM
  5. checkboxes to display records
    By jamie123 in forum Forms
    Replies: 1
    Last Post: 05-13-2009, 10:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums