When going to next record with Images - i get an error

Alloyd

Registered User.
Local time
Today, 15:07
Joined
Feb 1, 2006
Messages
15
I have a database that displays images. If I do not wait for them all to paint (Show up) and click on the next record, I do not really get an error but what I do get is the Status Bar stuck in the screen and it always stays on top of everything. I attached a JPG image of what I am talking about, any help would be greatly appreciated. ALSO: If I use too high of resolution on the pictures, when I go to print preview on a report I custom made, I am missing a picture or two. Any Ideas on how to correct this?

Here is the code I am using for linking the images that is on Form_Current():

Private Sub Form_Current()
On Error GoTo HandleErr

Me.RecordsetClone.MoveLast

' **** Realtor Image Handle
If Not IsNull([Realtor_Image_Location_frm]) Then
Forms!frm_Payments_Entry![Img_Agent].Picture = [Realtor_Image_Location_frm]
SysCmd acSysCmdSetStatus, "Image: '" & [Realtor_Image_Location_frm] & "'."
DoCmd.RepaintObject
Else
Forms!frm_Payments_Entry![Img_Agent].Picture = ""
SysCmd acSysCmdClearStatus
DoCmd.RepaintObject
End If

' **** Main Home Picture Handle
If Not IsNull([Image_location_frm]) Then
Forms!frm_Payments_Entry![Img_Main].Picture = [Image_location_frm]
SysCmd acSysCmdSetStatus, "Image: '" & [Image_location_frm] & "'."
DoCmd.RepaintObject
Else
Forms!frm_Payments_Entry![Img_Main].Picture = ""
SysCmd acSysCmdClearStatus
DoCmd.RepaintObject
End If

' **** 1 Home Picture Handle
If Not IsNull([loc_Img_side_1]) Then
Forms!frm_Payments_Entry![Img_side_1].Picture = [loc_Img_side_1]
SysCmd acSysCmdSetStatus, "Image: '" & [loc_Img_side_1] & "'."
Else
Forms!frm_Payments_Entry![Img_side_1].Picture = ""
SysCmd acSysCmdClearStatus
End If

' **** 2 Home Picture Handle
If Not IsNull([loc_Img_side_2]) Then
Forms!frm_Payments_Entry![Img_side_2].Picture = [loc_Img_side_2]
SysCmd acSysCmdSetStatus, "Image: '" & [loc_Img_side_2] & "'."
Else
Forms!frm_Payments_Entry![Img_side_2].Picture = ""
SysCmd acSysCmdClearStatus
End If

' **** 3 Home Picture Handle
If Not IsNull([loc_Img_side_3]) Then
Forms!frm_Payments_Entry![Img_side_3].Picture = [loc_Img_side_3]
SysCmd acSysCmdSetStatus, "Image: '" & [loc_Img_side_3] & "'."
Else
Forms!frm_Payments_Entry![Img_side_3].Picture = ""
SysCmd acSysCmdClearStatus
End If

' **** 4 Home Picture Handle
If Not IsNull([loc_Img_side_4]) Then
Forms!frm_Payments_Entry![Img_side_4].Picture = [loc_Img_side_4]
SysCmd acSysCmdSetStatus, "Image: '" & [loc_Img_side_4] & "'."
Else
Forms!frm_Payments_Entry![Img_side_4].Picture = ""
SysCmd acSysCmdClearStatus
End If

' **** 5 Home Picture Handle
If Not IsNull([loc_Img_side_5]) Then
Forms!frm_Payments_Entry![Img_side_5].Picture = [loc_Img_side_5]
SysCmd acSysCmdSetStatus, "Image: '" & [loc_Img_side_5] & "'."
Else
Forms!frm_Payments_Entry![Img_side_5].Picture = ""
SysCmd acSysCmdClearStatus
End If

Exit Sub

HandleErr:
If Err = 2220 Then
Forms!frm_Payments_Entry![Img_Agent].Picture = ""
SysCmd acSysCmdSetStatus, "Can't open image: '" & [Realtor_Image_Location_frm] & "'"

Forms!frm_Payments_Entry![Img_Main].Picture = ""
SysCmd acSysCmdSetStatus, "Can't open image: '" & [Image_location_frm] & "'"

Forms!frm_Payments_Entry![Img_side_1].Picture = ""
SysCmd acSysCmdSetStatus, "Can't open image: '" & [loc_Img_side_1] & "'"

Forms!frm_Payments_Entry![Img_side_2].Picture = ""
SysCmd acSysCmdSetStatus, "Can't open image: '" & [loc_Img_side_2] & "'"

Forms!frm_Payments_Entry![Img_side_3].Picture = ""
SysCmd acSysCmdSetStatus, "Can't open image: '" & [loc_Img_side_3] & "'"

Forms!frm_Payments_Entry![Img_side_4].Picture = ""
SysCmd acSysCmdSetStatus, "Can't open image: '" & [loc_Img_side_4] & "'"

Forms!frm_Payments_Entry![Img_side_5].Picture = ""
SysCmd acSysCmdSetStatus, "Can't open image: '" & [loc_Img_side_5] & "'"

Else
MsgBox Err.Description, vbExclamation
End If
End Sub
 

Attachments

  • image_pictures.jpg
    image_pictures.jpg
    78.4 KB · Views: 166
Hi,

How was your pictures stored? In a Folder or in the tables?

Try Here
snip
I have a database that displays images. If I do not wait for them all to paint (Show up) and click on the next record, I do not really get an error but what I do get is the Status Bar stuck in the screen and it always stays on top of everything. I attached a JPG image of what I am talking about, any help would be greatly appreciated. ALSO: If I use too high of resolution on the pictures, when I go to print preview on a report I custom made, I am missing a picture or two. Any Ideas on how to correct this?
End Sub
 
My inclination is that the images are of a large size (Mb wise)

If you can reduce the image size it will enable it to load quicker.

Dave
 
The file sizes vary pending upon who took the picture with what camera. Most are about 1.5 megabytes. I was hoping there is some code I can use on custom navigations for next/previous record that would stop you from going to the next record until the current record loads all pictures. All pictures are linked not embedded. Paths are stored in a table.

I need high resolution because this program creates flyers for Realtors that has about 50 Templates. To get the best quality I did not want to limit file sizes but I am beginning to wonder if access can handle large file sizes.

Each report pulls up a background image, then in Access I have it place each of the images available along with dropping in text fields. Attached is an example of the final report which looks great. I just cant give the database application out until I fix how to keep people from getting that error. Any other ideas besides shrinking file sizes would be excellent.
 

Attachments

  • example_report.jpg
    example_report.jpg
    41.8 KB · Views: 159
Last edited:
I have a little label on the bottom of my images saying "Best image size is 600x800 pixels" or something similar. Most of my images are around 300Kb.

If you get a ruler out and measure the size on the actual paper, then having the image any bigger than that is not necessary.

I suggest you experiment with the image size and print resolution. I think you will be surprised how small you can make them without loosing print quality.

As for trapping the error, or bypassing the loading, I think access, like any Microsoft program, thinks it knows best, and just does its own thing.

Dave
 

Users who are viewing this thread

Back
Top Bottom