Getting an error with picture loading...

C

Cybert

I have a database with about 100 records. There is a 95K .jpg file
that accompanies each record. Embedding or linking to these images
made my database too large, so I put a picture object in my form and
I'm loading the images that way. Here's the code:

------------------------------

Private Sub Form_Current()
On Error GoTo Err_Form_Current
If Forms!Pogo_Form.CurrentView = 1 Then
Forms!Pogo_Form.screen.Picture = Left$(CurrentDb.Name,
Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name))) & "Screens\" +
Me.GameName + ".jpg"
End If
Exit_Form_Current:
Exit Sub

Err_Form_Current:
Forms!Pogo_Form.screen.Picture = Left$(CurrentDb.Name,
Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name))) & "Screens\" +
"no_image.jpg"
Resume Exit_Form_Current
End Sub

------------------------------

Everything was working fine until I tried to post my database on the
network. Now, the picture loading is so slow that when users advance
through the records too quickly (before the images have had a chance to
load) the little import image bar that comes up is getting "stuck" on
the screen. (It won't go away, even when I hit the "x" and cancel.)
When I quit out of Access there is a crash.

I'm pretty new to VBA programming so any tips or suggestions would be
greatly appreciated.
 
S

Stephen Lebans

Here's a previous post of mine on this issue.

The one thing you must do is turn of the Loading Image dialog. If you don't,
and quickly scroll through the records in Form view, or page quickly in
Print Preview, you run the risk of crashing Access. Use the Registry mod at
the Access MVP site:


Additionally, two issues in regards to the Registry modification pointed to
here http://www.mvps.org/access/api/api0038.htm

1) The Registry key MUST be "No" NOT "no" or "NO"


2) On systems with XP or on systems with more than one user account,
you must add/modify the key in both HKEY_CURRENT_USER and
HKEY_LOCAL_MACHINE.


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top