When Access saves a form with a linked image control, It saves the last-used image name in the Picture property.
When I sync my 2 computers, if I have changed code, starting the program on the other computer causes message - "Microsoft Access can't open the file 'D:\Old image name.jpg'.
This occurs before the Form.Open event.
Can I trap this, or cancel this or change some property of the image control when I save the form so this doesn't happen. I tried to change the visible property, but that didn't work. Error occurs even if control not visible.
This message will occur every time I use the program until I save the form again. That will cause the sync routines to copy the now most recent version to the other machine, and the problem occurs again.
Can I put a stop to this annoyance?
5 5301 @OldBirdman
Hello, OldBirdman.
I couldn't reproduce that. In my case it didn't use last linked picture file and didn't ask to save form on closing after Picture property if Image control was modified via code.
Regards,
Fish
Thanks Fish. So if you open the form in design view, what are the property values for imgCtl.Picture and imgCtl.PictureType?
As soon as I create an Image Control, Access asks for an Image name. If I don't enter a name in the dialog, the control is removed.
Now there is a name in imgCtl.Picture. It is C:\Pictures\TestImage.jpg and this name persists when I change Picture type from Embedded to Linked. When I move my Access project to my laptop (Vista), data is on the D:\ drive, so the picture name is invalid. Each time I use the program on the laptop, I am told that Access can't open this file. This message happens before the Form Open Event, so I can't trap it.
To stop the messages, I must open the form in design view. My code knows where the pictures are, so when I switch to design view, ingCtl.Picture is valid. If I save the form, the picture name will be invalid on the desktop. If I don't save the form from design view, the picture name will continue to be invalid on the laptop.
I have 14 projects that use images, and this has gotten more that just annoying.
I've created Image control with some dummy picture (Access refuses to create one if no picture file was specified).
Then in Image control properties I've changed PictureType value to Linked and cleared Picture value (it turned to "(none)").
Additionally, if you want an Image control to display whatever default picture, then you may embed this picture into the Image control and, then, before the Image control is populated with a new picture, set PictureType to Linked. -
With imgCtl
-
.PictureType = 1
-
.Picture = strPicPath
-
End With
-
If I do that, I get a msgbox "Do you want to remove this picture from this form?" Stupid me, my brain intepreted that to mean 'Do I want to remove the control' because I don't consider a linked picture to be part of the form.
Thank you for setting me straight.
You are welcome.
Best regards,
Fish
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Kenny |
last post by:
I have been trying to write a script that will increase the size of
and image when you mouse over it, and decrease it to original size,
when you mouse out. After a couple of attempts, this is what...
|
by: David W. Simmonds |
last post by:
I have a DataList control that has an Image control in the ItemTemplate. I
would like to resize the image that goes into that control. I have a series
of jpg files that are full size, full...
|
by: strout |
last post by:
It's a pain to create each button with 2 images: button_on.gif button_off.gif
I am looking for a control that have on/off two states, preferred as BACKGROUND images and with button text on it.
...
|
by: Fahad Aijaz |
last post by:
Hi,
I am trying to display a Png image via ASP .NET. I get the image from the
stream, creates the Bitmap, set the content type to Image/Png, but it give an
error. If I set the content type to...
|
by: Jeronimo Bertran |
last post by:
Hello,
I am using a rendering aspx page to display a database image on an Image
control. When the database record is retrieved, I am saving the bitmap
to a session variable for the rendering...
|
by: jens.buchta |
last post by:
Hi!
I'm using a DataGrid with a template column to display an Image inside
of it. I'm hooking into its OnPrerender-Event to set the
ImageURL-Property dynamically.
Everything works just fine...
|
by: jens Jensen |
last post by:
Hello,
I have an image file name in a table that a let users modify via a
GridView/DetailView pair.
* The actual image file is saved in the image folder of the application.
But the image is...
|
by: den 2005 |
last post by:
Hi everyone,
Here is code working on..Trying to insert record with a column with Image
or VarBinary datatype in sql database from a existing jpeg image file, then
retrieve this image from...
|
by: |
last post by:
I have a few custom controls that expose properties of type Image. The built in controls that have Image properties allow you to delete the image and set it back to "None". How can I allow my own...
|
by: premprakashbhati |
last post by:
hi, good evening..
i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button()
here is the code ...its work fine...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |