473,513 Members | 2,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linked image will not refresh when image property is changed.

Scenario: Have a product form with an "image location" field. The
image property uses this field to display the image.

Problem: If an image location field has been changed, the image will
not refresh, even after putting a "refresh", or "repaint" or "requery"
statement in the afterupdate event. The only way to make it update is
to move to the next record and then move back again.
Private Sub Stock_ImageLocation_AfterUpdate()
If Me.Stock_ImageLocation.Value "1" Then
Me.Image98.Picture = Me.Stock_ImageLocation

Me.Refresh

If Len(Me.Stock_ImageLocation & "") 0 _
And Len(Dir(Me.Stock_ImageLocation)) 0 Then
Me.Image98.Picture = Me.Stock_ImageLocation
Me.Image98.Visible = True
Else
Me.Image98.Visible = False
End If
Else
Me.Image98.Visible = False
Me.Repaint
End If

End Sub

Hope you can help.

Feb 16 '07 #1
5 8612
On 16 Feb., 14:28, mattcolen...@gmail.com wrote:
Scenario: Have a product form with an "image location" field. The
image property uses this field to display the image.

Problem: If an image location field has been changed, the image will
not refresh, even after putting a "refresh", or "repaint" or "requery"
statement in the afterupdate event. The only way to make it update is
to move to the next record and then move back again.

Private Sub Stock_ImageLocation_AfterUpdate()
[]
Possibly the AfterUpdate event doesn't happen at all.
So far as I tested it under AfterUpdate(), it refreshes the picture
only after I quit someway the field (Tab, Enter, navigate, move
focus).

Put a MsgBox "hallo" in AfterUpdate() and see.

Or put your code under the Change event instead of AfterUpdate and see
what happens.

If it still doesn't refresh the picture, tell us.

Marco P
Feb 16 '07 #2
On 16 Feb, 14:18, "Marco Pagliero" <mart...@web.dewrote:
On 16 Feb., 14:28, mattcolen...@gmail.com wrote:
Scenario: Have a product form with an "image location" field. The
image property uses this field to display the image.
Problem: If an image location field has been changed, the image will
not refresh, even after putting a "refresh", or "repaint" or "requery"
statement in the afterupdate event. The only way to make it update is
to move to the next record and then move back again.
Private Sub Stock_ImageLocation_AfterUpdate()
[]

Possibly the AfterUpdate event doesn't happen at all.
So far as I tested it under AfterUpdate(), it refreshes the picture
only after I quit someway the field (Tab, Enter, navigate, move
focus).

Put a MsgBox "hallo" in AfterUpdate() and see.

Or put your code under the Change event instead of AfterUpdate and see
what happens.

If it still doesn't refresh the picture, tell us.

Marco P
Thanks for taking a look. after putting a msgbox in both _change and
_afterupdate, it does not pop the message up.

*************One thing I have forgotten to mention is that the
imagepath field is update using vba**************

If I type in a file path manually all appears to work without issue. I
am calling an explorer popup to select a file (and record the filename
and path in the filepath field). It would appear that none of my
"me.refresh" are working. Thanks for looking into this again.

Feb 16 '07 #3
On 16 Feb., 16:03, mattcolen...@gmail.com wrote:
Thanks for taking a look. after putting a msgbox in both _change and
_afterupdate, it does not pop the message up.

*************One thing I have forgotten to mention is that the
imagepath field is update using vba**************
Yes, also the help says that _change and _afterupdate aren't
triggered if the new value comes from VB or from a macro.

But if I change the .picture property from VB, the control seems to
refresh allright, so try and set the property directly in the module
after you get the filename and set Stock_ImageLocation.

I mean, somewhere you must have written something like:

forms!myForm!Stock_ImageLocation = somefilenamefromexplorer

then the next line will be

forms!yourForm!Image98.Picture = forms!yourForm!Stock_ImageLocation
(forms!yourForm!Image98.Picture = somefilenamefromexplorer)

There you can also set .visible if you like.

greetings
Marco P

Feb 16 '07 #4
On 16 Feb, 16:42, "Marco Pagliero" <mart...@web.dewrote:
On 16 Feb., 16:03, mattcolen...@gmail.com wrote:
Thanks for taking a look. after putting a msgbox in both _change and
_afterupdate, it does not pop the message up.
*************One thing I have forgotten to mention is that the
imagepath field is update using vba**************

Yes, also the help says that _change and _afterupdate aren't
triggered if the new value comes from VB or from a macro.

But if I change the .picture property from VB, the control seems to
refresh allright, so try and set the property directly in the module
after you get the filename and set Stock_ImageLocation.

I mean, somewhere you must have written something like:

forms!myForm!Stock_ImageLocation = somefilenamefromexplorer

then the next line will be

forms!yourForm!Image98.Picture = forms!yourForm!Stock_ImageLocation
(forms!yourForm!Image98.Picture = somefilenamefromexplorer)

There you can also set .visible if you like.

greetings
Marco P
Dude, how stupid am I. Guess what.........

I was concentrating so much on making the filepath field update that I
completely missed to update the actual .picture property. I'm not
gonna say how long I have been looking at the code, trying to make it
work! What I numpty. It was only when I saw your

(forms!yourForm!Image98.Picture = somefilenamefromexplorer)

statement that I knew what I was doing wrong. Your a genious.... We
are mere peasants.

Thanks for your help.
CASE CLOSED!!!


Feb 16 '07 #5
On 16 Feb., 20:31, mattcolen...@gmail.com wrote:
>
Dude, how stupid am I. Guess what.........

I was concentrating so much on making the filepath field update that I
completely missed to update the actual .picture property. I'm not
gonna say how long I have been looking at the code, trying to make it
work! What I numpty. It was only when I saw your

(forms!yourForm!Image98.Picture = somefilenamefromexplorer)

statement that I knew what I was doing wrong. Your a genious.... We
are mere peasants.

Thanks for your help.
Hi Matt, don't be sad, it happens again and again to focus so much on
some special solution that one doesn't see the original problem any
more. As some say: concentrate on the fur, but don't forget the claws.

Glad I could help, and to be called a genius once in a while is also
quite agreable but don't do it too often, please. You would embarrass
me, as I'm much too modest. This is actually my only fault.

Greetings
Marco P

Feb 18 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
6142
by: Randell D. | last post by:
Folks, I'm still learning javascript - I've invested in a couple of books and reading online as much as possible. I'm pretty sure what I am suggesting is possible though I'm trying to weigh up...
12
2613
by: Neil | last post by:
I previously posted re. this, but thought I'd try again with a summary of facts. I have an Access 2000 MDB with a SQL Server 7 back end. There is a view that is linked to the database via ODBC...
6
3447
by: Arnold | last post by:
Hi there, I've looked at numerous posts out there but have yet to find a solution to this. I have an image control on a main form that shows a linked jpeg thumbnail. Image controls are also on...
1
2066
by: chrisse_2 | last post by:
I am going to try and explain what i think is happening in my form. The records in my database each contain pictures. In some cases multiple pictures. I have linked these images to my database...
2
1296
by: Earl Teigrob | last post by:
I have written a photo app that allows the administrator to resize photos in an admin panel above the photo on the page. When the the new size is entered, the data is saved into a datastore and the...
2
1953
by: mikeoley | last post by:
Ok I have a Javascript slideshow working. Every image is linked to a another page in the site. Problem is...The link wont refresh to the next link once the second images rollovers in the slideshow....
11
12436
by: nuhura01 | last post by:
Hi.. I have a button to preview image using the following code, which preview the image in html page: Dim oStringWriter As System.IO.StringWriter = New System.IO.StringWriter Dim...
25
45695
by: bubbles | last post by:
Using Access 2003 front-end, with SQL Server 2005 backend. I need to make the front-end application automatically refresh the linked SQL Server tables. New tables will be added dynamically in...
0
7260
marktang
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,...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5090
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3223
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.