Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting a picture into a form according to selection in code. 1

Status
Not open for further replies.

InkyRich

Technical User
Aug 2, 2006
126
GB
Hello all,
I am trying to place a picture into a form according to the selection made in code, this can vary according to what selection is made. For example a selection is made for a type of wall design and according to the choice made it puts the criteria into a form. The picture goes with the selection. When I try this code:

Code:
Me.imgStyle1.Picture = "Brick Coping 2.jpg"

It does not like this code and creates an error. What am I doing wrong?

Hope to hear from you.
InkyRich

A fool and his money are soon parted - so you might as well send it to me!
 
How are ya InkyRich . . .

Enter the full path [blue]Drive:\Path\FileName.ext[/blue] instead . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
InkyRich . . .

[blue]Very Important:[/blue] In form design view be sure to set the forms [blue]Picture Type[/blue] property to [blue]Linked[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
creates an error
Any chance you could post the error message ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hello all,
I apologise for not getting back to you guys earlier I have been away.
I have tried the first ideas but they do not work.
PHV the error message is Run-time error '2220'
Microsoft Office Access cannot open the file 'Half brick coping 1.jpg'
Inky

A fool and his money are soon parted - so you might as well send it to me!
 
InkyRich . . .

In form design view, enter the full path & filename to another [blue].jpg[/blue]. Does it work?

If not try the same with [blue].bmp[/blue]?

Post the results . . .

Its possible ms graphic filters were not installed.

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Hi AceMan,
Thanks for your reply. I have tried it with a bitmap and get the same message.
Inky

A fool and his money are soon parted - so you might as well send it to me!
 
InkyRich . . .

Can you open the graphic files thru windows explorer?

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Hi AceMan,
Explorer is not an option but it will open in Office Picture Manager.

A fool and his money are soon parted - so you might as well send it to me!
 
get the same message
Are you using a full pathname ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
InkyRich . . .

Post a full path that you've tried!
InkyRich said:
[blue][purple]Explorer is not an option[/purple] but it will open in Office Picture Manager.[/blue]
Just making sure the file isn't corrupted.

Best I can offer at this point is to make sure [blue]Graphic Filters[/blue] were turned on during installation of Office or Access. Don't know what version access you have, but following for [blue]2K[/blue] is a guide line for what you need to do to check/install the filters:
[ol][li]Open [blue]Add/Remove Programs[/blue] in [blue]Control Panel[/blue].[/li]
[li]Navigate to and select the installed Access program (Microdoft Office or Microsoft Access if stand alone),[/li]
[li]Click the Add/remove button ([green]don't worry! . . . your not going to delete![/green]).[/li]
[li]A dialog pops up with several options, one of which allows you to modify the installation. Note: for current versions [green]you may have to click a customize checkbox.[/green][/li]
[li]You want to navigate to [blue]Converters & Filters[/blue] - [blue]Graphic Filters[/blue].[/li]
[li]Make sure all the graphic filters are enabled and continue if necessary to install, or, cancel out if all are already installed.[/li][/ol]
[blue]Let us know how you make out with this . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks very much AceMan for your detailed information.
Its guys like you who make this site valuable. Have a star!
I will try this and get back to you.
Inky

A fool and his money are soon parted - so you might as well send it to me!
 
Hello all,
Just to let you know that I cracked the problem. It was due to me not setting up the path correctly. The graphic is now working as planned.
Thanks for all your help.
Pleased to see AceMan as number 1.
Inky

A fool and his money are soon parted - so you might as well send it to me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top