Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 11-11-2008, 10:32 AM   #1
irish634
Newly Registered User
 
Join Date: Sep 2008
Posts: 230
Thanks: 5
Thanked 6 Times in 5 Posts
irish634 is on a distinguished road
Image/Form Refresh/requery issue

Hi All,

Please reference the attachment. The item in particular is the image box.

I have the code so that when I double-click, I insert an image, and the image shows up via the "Me.Requery" statement.

The weird thing is when I delete the image, and try to requery the form, the image box does not refresh and the deleted image stays in the image box until I close the form and re-open it.

Any Ideas?
Thanks,
Craig

ImageTest.zip

irish634 is offline   Reply With Quote
Old 11-11-2008, 11:50 AM   #2
WayPay
Registered User
 
WayPay's Avatar
 
Join Date: Nov 2008
Location: The Netherlands
Posts: 118
Thanks: 0
Thanked 0 Times in 0 Posts
WayPay is on a distinguished road
Re: Image/Form Refresh/requery issue

Be aware that the 'Kill sFile' deletes a file bypassing the recycle bin. You don't even need to delete the file.
Code:
Private Sub Form_Current()
On Error GoTo Error_Handler

    If IsNull(DLookup("[txt_CoLogo]", "tbl_CompanyInfo", "lng_RecordID=1")) Or DLookup("[txt_CoLogo]", "tbl_CompanyInfo", "lng_RecordID=1") = "" Then
        Me.img_CoLogo.Picture = ""
        Exit Sub
    Else
        img_CoLogo.Picture = DLookup("[txt_CoLogo]", "tbl_CompanyInfo", "lng_RecordID=1")
    End If
    
Error_Handler_Exit:
    Exit Sub

Error_Handler:
    MsgBox Err.Number & vbCrLf & Err.Description, vbInformation, "Error"
    Err.Clear
    Resume Error_Handler_Exit
    
End Sub
The image still only gets cleared after the message 'logo has been deleted', but I'll leave it to you to fix that .
WayPay is offline   Reply With Quote
Old 11-11-2008, 12:19 PM   #3
irish634
Newly Registered User
 
Join Date: Sep 2008
Posts: 230
Thanks: 5
Thanked 6 Times in 5 Posts
irish634 is on a distinguished road
Re: Image/Form Refresh/requery issue

Quote:
Originally Posted by WayPay View Post
Be aware that the 'Kill sFile' deletes a file bypassing the recycle bin. You don't even need to delete the file.
Code:
Private Sub Form_Current()
On Error GoTo Error_Handler

    If IsNull(DLookup("[txt_CoLogo]", "tbl_CompanyInfo", "lng_RecordID=1")) Or DLookup("[txt_CoLogo]", "tbl_CompanyInfo", "lng_RecordID=1") = "" Then
        Me.img_CoLogo.Picture = ""
        Exit Sub
    Else
        img_CoLogo.Picture = DLookup("[txt_CoLogo]", "tbl_CompanyInfo", "lng_RecordID=1")
    End If
    
Error_Handler_Exit:
    Exit Sub

Error_Handler:
    MsgBox Err.Number & vbCrLf & Err.Description, vbInformation, "Error"
    Err.Clear
    Resume Error_Handler_Exit
    
End Sub
The image still only gets cleared after the message 'logo has been deleted', but I'll leave it to you to fix that .
Thanks. Sometimes I overlook the obvious thinking it's more involved than it actually is.
As far as the "kill" yes, deleting the file is the goal. I'll probably remove it though.

irish634 is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Report Column alignment - Printer Issue? pvs Reports 6 10-22-2008 09:24 AM
Need help with a report numbering issue CalvinToo Forms 37 08-13-2008 08:13 AM
Weird issue in Access 2003 Chungalin General 1 01-07-2005 09:52 PM
[SOLVED] How do I issue items from a multi-level inventory? ltl Forms 5 01-27-2004 12:32 PM
create table based on sequential data-one title, many issue numbers for each angarahad Tables 2 04-19-2003 02:15 PM




All times are GMT -8. The time now is 01:17 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World