Results 1 to 3 of 3
  1. #1
    Tycho4511 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    4

    Button to Toggle Image On/Off


    Hello,

    I am creating a database of all the artwork we use in our creation of videos. One of the fields on the form view shows a thumbnail of the image. Some of the images are quite large, thus I did not embed them. Linking works great but moving from one record to the next is a little slow at times, I understand this is just a byproduct of linking large files. To quickly move through the records I go into design and make the thumbnail field not visible. This works for me but for other users I would like to have a simple way to turn the thumbnail image off or on. It seems like a button on the form toggling this would be optimal. Is there a basic way to set this up? Thanks!

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,128
    Sample code for a standard button

    Code:
    Private Sub cmdHideShow_Click()
    
    If Me.cmdHideShow.Caption="Hide Image" Then
       Me.cmdShowHide.Caption="Show Image"
       Me.ImageControlName.visible=False
    Else
       Me.cmdShowHide.Caption="Hide Image"
      Me.ImageControlName.visible=True
    End If
    
    End Sub
    Modify button and image control names as necessary
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  3. #3
    Tycho4511 is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    4
    Quote Originally Posted by ridders52 View Post
    Sample code for a standard button

    Code:
    Private Sub cmdHideShow_Click()
    
    If Me.cmdHideShow.Caption="Hide Image" Then
       Me.cmdShowHide.Caption="Show Image"
       Me.ImageControlName.visible=False
    Else
       Me.cmdShowHide.Caption="Hide Image"
      Me.ImageControlName.visible=True
    End If
    
    End Sub
    Modify button and image control names as necessary

    Great, thanks for the help. I was able to get it set up. I did have to change the name on lines 2 and 5 of the code from ShowHide to HideShow.

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

Similar Threads

  1. Replies: 13
    Last Post: 01-24-2018, 02:51 PM
  2. Toggle Button
    By gheyman in forum Access
    Replies: 2
    Last Post: 07-11-2017, 07:43 AM
  3. Toggle Button Help
    By dbalilti in forum Access
    Replies: 1
    Last Post: 07-05-2012, 04:23 AM
  4. Toggle Button Criteria
    By tylerg11 in forum Forms
    Replies: 2
    Last Post: 03-02-2012, 09:28 AM
  5. Toggle Button Options
    By Matthieu in forum Forms
    Replies: 2
    Last Post: 11-23-2009, 04:05 PM

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