How to remove image from ACCESS FORM

Path to PictureHi,

 I am working on the ACCESS database that someone developed. Each form uses a certain kind of graphics file such as .jpg, .ico.
 Since I am working on this database from my work environment, whenever I tried to open any form, it hangs for a while looking for the graphics file which does not exist on my network.
 I try to remove it from the form property, but that is not easy either.
 Whenever I highlight  the whole path & graphics file name and press [Delete] key, it disappears, but as soon as I leave the field, then it comes right back.

 How can I remove the use of any graphics on the form?

Thanks.
LVL 1
sgleeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
I've had this issue many times ... especially the one where it says the :OLE Server is not registered .... "  I use this code to get rid of the 'stuck' image:


Public Function DXM_zzDeleteImageOLE(sFrmName As String, ctlName As String) As String

    'This will get rid of a stuck OLE image on a form, wherein you get the message "OLE Server not registered ..."

    ' ?APP_zDeleteImageOLE("","")
    DoCmd.OpenForm sFrmName, acDesign
    DeleteControl sFrmName, ctlName
    DoCmd.Close acForm, sFrmName, acSaveYes
    DXM_zzDeleteImageOLE = "Control Deleted"
   

End Function

Pass (or hard code) the name of the Form and the Control Name.
0
sgleeAuthor Commented:
Maybe I was not clear what my problem was.

I do not get "OLD Server not registered..." message.

The path in the form property is correct and vaild in the production environment/network.
Since I took the copy of the database to do some work and tried to open the form on my network, it generates an error complaining that the folder/file don't exist, which makes perfect sense because simply the path don't exist.

The question is how can I remove it so that it does not look for any graphics.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Remove it ... from the Form Property sheet?
Using the code I supplied. Ignore my comment about OLE ....
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

sgleeAuthor Commented:
I created a module where put that function.
Then I created a macro that called that function, but it generated an error when I ran the macro.
Macro error1Macro error2Macro error3
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
You don't need a Macro, and you have to pass the Form Name and Control Name . or . just hard code the Form and Control Names.

You can run the code directly in the Module>>Function by hitting F5

Hard coded  version - just hit F5 to run

Public Function DXM_zzDeleteImage() As String

   Dim sFrmName As String
    sFrmName = "YourFormNameHere"

 
    DoCmd.OpenForm sFrmName, acDesign
    DeleteControl sFrmName, "YourControlNameHere"
    DoCmd.Close acForm, sFrmName, acSaveYes
    DXM_zzDeleteImageOLE = "Control Deleted"
   

End Function
0
sgleeAuthor Commented:
In your code, I just noticed  DeleteControl sFrmName, "YourControlNameHere".
Since it is in the form property, what would be the name of the control for that?
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
OK ... sorry ... I see it's only for the Form ...
Let me modify the code if I can ...
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Ok ... I just tried this and it worked. Replace "Form9" with your Form name:

Public Function aaaTest()

    DoCmd.OpenForm "Form9", acDesign
    Forms!Form9.Picture = "(none)"
    DoCmd.Close acForm, "Form9", acSaveYes
    aaaTest = "Picture Deleted"

   

End Function
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sgleeAuthor Commented:
I ran the code against a couple of forms and it took longer time that I thought it would take, but it ran both times, but when I open those forms, I still get the error about the path not found.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
Interesting.
It should only take a second literally. Opens in Design view, removes, closes w/save.
Any chance you can upload a db with this Form ... and be sure it has the issue?

mx
0
sgleeAuthor Commented:
I would love to, but I can't due to confidentiality...

Is there a way to remove this by editing form properties manually?
0
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPDesigner and DeveloperCommented:
I have been following this.

I am curious and a few things.

1)  what is the database format( 2000, 2002/2003 .MDB or 2007 .ACCDB)?

2) What version of Access are you running including SP level and bits?

I have run into similar issues with Access 2010 trying to edit a 2002/2003 MDB that uses ULS for user log on tracking only if the correct .mdw is not used.
0
sgleeAuthor Commented:
1) it is mdb. so has to be 2003 or earlier. In fact this database was developed a few years ago. so my guess is probably right.
2) I am using a computer that has office 2003 pro. version simply because I can't get used to 2010 user interface.
3) this is a simply user .mdb database. no mdw is developed.
0
sgleeAuthor Commented:
I keep thinking it is a matter of removing those graphical stuff from the right properties.
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
"'I would love to, but I can't due to confidentiality..."
Just this Form in an empty db ...
0
sgleeAuthor Commented:
I figured it out.

In the Picture property of the form (see my original posting), I chose another graphics file located in my local hard drive. The ACCESS form displayed the contents of graphics from my local C drive. Then I deleted the path and file name from the Picture field. ACCESS displayed the prompt to confirm for deletion. When I answered YES, then it changed the field to "None". Please see the screenshots.

Form Picture 1Picture Removal ConfirmationForm Picture Removed
0
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database Architect / Systems AnalystCommented:
OK ... so, problem solved ?
My code set it to None.
0
sgleeAuthor Commented:
Yes. The problem solved. Thank you.
0
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPDesigner and DeveloperCommented:
I suspect the time delay with MX's code was do the the path being invalid.

Glad you got it sorted out.
0
sgleeAuthor Commented:
There are two ways of doing it.
One way was to assign "None" to the picture property of the form using VB. For some reason that did not work out for me.
So I had to manually assign a local picture file from the C drive and set the picture property to None. That worked.
But I think VB code should have worked too.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.