+ Reply to Thread
Results 1 to 2 of 2

Image Trouble

  1. #1
    Registered User
    Join Date
    02-15-2006
    Posts
    93

    Image Trouble

    Good evening,

    I have a userform that has an image control. I want to enable a user to change the image and for that image to appear on the user form from that point on. I have it so that a user can load an image using the following code:

    Private Sub GetImage_Click()
    Dim myPictName As Variant

    myPictName _
    = Application.GetOpenFilename("Picture files, *.bmp;*.jpg;*.gif")
    If myPictName = False Then
    MsgBox "Error: No image selected!"
    Exit Sub
    End If

    SetGoals.Image1.Picture = LoadPicture(myPictName)
    SetGoals.Image1.PictureSizeMode = fmPictureSizeModeZoom
    End Sub

    The problem is that the image is not saved. Everytime the user comes to the form, they have to reload an image. Any ideas?

    As always, thank you in advance for your help. It is really appreciated.
    dw

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You can't save the result to a Form, you would need to store the selection somewhere, probably in a hidden sheet.

    Remember to use Code Tags
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1