transfer the image from Open Dialog Box

C

Craig

I have a open dialog box that I want to take the .jpg or gif or whatever and
put it into my image box. I got the err.number=5 covered. Here is the code:

Set dlgOpen = Application.FileDialog(msoFileDialogOpen)

With dlgOpen
.Title = "Add your company logo here"
.Filters.Add "All Files", "*.*", 1
.AllowMultiSelect = False
.Show
End With

'Returns the table connection file path string.
sLogoPath = dlgOpen.SelectedItems.Item(1) 'Can only be item 1.
Me.LogoPath = sLogoPath
Me.LogoImage = sLogoPath

Also I keep getting error number 438. Object does not support this.

Any help appreciated.
 
A

Arvin Meyer MVP

I assume LogoImage is the name of the image box? If so, the code should
read:

Me.LogoImage.Picture = sLogoPath
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top