From: Salad on
Prakash wrote:
> On Apr 10, 10:36 pm, Salad <sa...(a)oilandvinegar.com> wrote:
>
>>Prakash wrote:
>>
>>>I'm using the foll code to display images from a folder on a form.
>>
>>>Each time I try to scroll to the "next" record a small window flashes
>>>past saying:
>>>"Importing C:\Al-Maha-Membership\Snaps\FILENAME.jpg"
>>
>>>1) Why does this appear even though I've specified: Application.Echo
>>>False
>>
>>>2) If I wait for some time (say 1 sec) between each click to go to the
>>>next record there's no problem. However, if I try to scroll fast the
>>>program hangs after scrolling say 8 to 10 records and Access pops up a
>>>message saying:
>>>Microsoft Office Access has encountered a problemand needs to close.
>>>We are sorry for the inconvenience.
>>
>>>Using Access 2003 over Windows Xp SP3.
>>
>>>Could someone please look at my code and point out as to where I'm
>>>going wrong ?
>>
>>>Private Sub Form_Current()
>>
>>> Application.Echo False
>>> Dim stFileName As String
>>> stFileName = "C:\Al-Maha-Membership\Snaps\" + Me.MembershipNo +
>>>".jpg"
>>
>>> If Dir(stFileName) = "" Then
>>> 'MsgBox "file does not exist"
>>> Me.Image_Holder.Picture = ""
>>> Me.Lbl_NoPhotoAvailable.Visible = True
>>> Else
>>> 'MsgBox "file does exist"
>>> Me.Image_Holder.Picture = "C:\Al-Maha-Membership\Snaps\" +
>>>Me.MembershipNo + ".jpg"
>>> Me.Lbl_NoPhotoAvailable.Visible = False
>>> End If
>>> Application.Echo True
>>
>>>End Sub
>>
>>>Rgds,
>>>Prakash.
>>
>>Maybe the pics are huge? Or you have a lot if them.
>>
>>I created a table. Contains 3 fields; ID, PicName, PicImage. Ex:
>> 1
>> Picture Of Me
>> C:\Pics\Pic1.jpg
>>
>>I created an image field on the form and named it PicImage. I set the
>>PictureType to linked, the Picture link blank.
>>
>>Then my code in the OnCurrent is
>> Me.PicImage.Picture = Me.PicLink
>>
>>I don't get your message. Maybe due to fewer pics, maybe smaller size.
>> Mine were about 300K. If your pics are 5 megs in size, maybe try
>>Irfanview (free program) and from the menu try Image/Resize.- Hide quoted text -
>>
>>- Show quoted text -
>
>
>
> Hi Salad ...
>
> I have approx 450 images in the folder. They are jpegs and the average
> size of each is approx 20kb. Largest file is 35kb.
>
> Someone else had written this membership application earlier and had
> used a bound object frame control with the photos embedded into it.
> The table contains approx 500 records and the database size is 1gb.
>
> I wanted to bring down the database size & so wanted to keep a
> "linked" image rather than embedding it into the database. And as far
> as I remember, this is the preferred and advised approach.
>
> Now when I try to scroll the "bound control" even by holding the mouse
> down ... the form hiccups (freezes) every 7 to 8 records and then
> continues scrolling for another say 8 records all the way till the end
> of the table. But NO CRASHING !! (now, this is with my linked image
> control disabled). The moment I enable my linked image control, the
> crash comes up. This is very frustrating.
>
> Any ideas ?? If it continues like this I may have to deliver the
> package with the embedded image control (ugh) ... the database is
> unnecessarily bloated.
>
> Rgds,
> Prakash.

I used an Image control. I did not use and Unbound or Bound Object
Frame control. I did not embed the image, but I did try that as well.
It didn't seem to make a speed difference since it was updating the
form's field via the current event, not the table field.

Do you have an old computer? Or perhaps your computer needs to be
rebooted? Or you have barebones memory?

From: Prakash on
On Apr 10, 11:03 pm, Prakash <sim...(a)omantel.net.om> wrote:
> On Apr 10, 9:47 pm, Tom van Stiphout <tom7744.no.s...(a)cox.net> wrote:
>
>
>
>
>
> > On Sat, 10 Apr 2010 10:09:15 -0700 (PDT), Prakash
>
> > <sim...(a)omantel.net.om> wrote:
>
> > The image control is an ActiveX control, and they are not directly
> > under the full control of their host. That's why .Echo does not work.
>
> > You are probably overloading it by scrolling too fast, and it crashes.
> > Nobody is perfect.
> > One thing that MAY work is if in Form_Current (which fires when you
> > scroll to the next record) you start a timer (Me.TimerInterval = 1)
> > and then in the Form_Timer event stop the timer (Me.TimerInterval = 0)
> > and then load your image.
>
> > -Tom.
> > Microsoft Access MVP
>
> > >I'm using the foll code to display images from a folder on a form.
>
> > >Each time I try to scroll to the "next" record a small window flashes
> > >past saying:
> > >"Importing C:\Al-Maha-Membership\Snaps\FILENAME.jpg"
>
> > >1) Why does this appear even though I've specified:   Application.Echo
> > >False
>
> > >2) If I wait for some time (say 1 sec) between each click to go to the
> > >next record there's no problem. However, if I try to scroll fast the
> > >program hangs after scrolling say 8 to 10 records and Access pops up a
> > >message saying:
> > >Microsoft Office Access has encountered a problemand needs to close.
> > >We are sorry for the inconvenience.
>
> > >Using Access 2003 over Windows Xp SP3.
>
> > >Could someone please look at my code and point out as to where I'm
> > >going wrong ?
>
> > >Private Sub Form_Current()
>
> > >    Application.Echo False
> > >    Dim stFileName As String
> > >    stFileName = "C:\Al-Maha-Membership\Snaps\" + Me.MembershipNo +
> > >".jpg"
>
> > >    If Dir(stFileName) = "" Then
> > >        'MsgBox "file does not exist"
> > >        Me.Image_Holder.Picture = ""
> > >        Me.Lbl_NoPhotoAvailable.Visible = True
> > >    Else
> > >        'MsgBox "file does exist"
> > >        Me.Image_Holder.Picture = "C:\Al-Maha-Membership\Snaps\" +
> > >Me.MembershipNo + ".jpg"
> > >        Me.Lbl_NoPhotoAvailable.Visible = False
> > >    End If
> > >    Application.Echo True
>
> > >End Sub
>
> > >Rgds,
> > >Prakash.- Hide quoted text -
>
> > - Show quoted text -
>
> Thank you Tom for getting back so fast.
>
> 1) So, is there any way to hide/disable that message (loading image
> message ...) ??
>
> 2) I'm not scrolling it TOO fast (but reasonably fast - Yes). I'm not
> continuously pressing the mouse (as with the bound image control)
> where it works perfectly albeit a little jerky. But no crashes there.
>
> 3) You timerinterval solution is new to me. Could you please show me
> exactly how to go about it as I've never used it before? Really
> though, I was hoping like in all my other forms (without image
> controls), the user can just stand on the "next record" icon with the
> mouse button depressed and watch the records zip past in a flash.
>
> If you can think of anything please do let me know. I really
> appreciate everyone's efforts  here.
>
> I hope you can furnish some more details on the timerinterval event.
>
> Warm Regards,
> Prakash.- Hide quoted text -
>
> - Show quoted text -


I tried the timerinterval solution as you suggested with a setting
upto 500 as below but it still crashes .... here's my code:
Private Sub Form_Current()

Me.TimerInterval = 500
Application.Echo False
Dim stFileName As String
stFileName = "C:\Al-Maha-Membership\Snaps\" + Me.MembershipNo +
".jpg"

If Dir(stFileName) = "" Then
'MsgBox "file does not exist"
Me.Image_Holder.Picture = ""
Me.Lbl_NoPhotoAvailable.Visible = True
Else
'MsgBox "file does exist"
Me.Image_Holder.Picture = "C:\Al-Maha-Membership\Snaps\" +
Me.MembershipNo + ".jpg"
Me.Lbl_NoPhotoAvailable.Visible = False
End If
Application.Echo True

End Sub

Private Sub Form_Timer()
Me.TimerInterval = 0
End Sub


Rgds,
Prakash.
From: Prakash on
On Apr 10, 11:09 pm, Salad <sa...(a)oilandvinegar.com> wrote:
> Prakash wrote:
> > On Apr 10, 10:36 pm, Salad <sa...(a)oilandvinegar.com> wrote:
>
> >>Prakash wrote:
>
> >>>I'm using the foll code to display images from a folder on a form.
>
> >>>Each time I try to scroll to the "next" record a small window flashes
> >>>past saying:
> >>>"Importing C:\Al-Maha-Membership\Snaps\FILENAME.jpg"
>
> >>>1) Why does this appear even though I've specified:   Application.Echo
> >>>False
>
> >>>2) If I wait for some time (say 1 sec) between each click to go to the
> >>>next record there's no problem. However, if I try to scroll fast the
> >>>program hangs after scrolling say 8 to 10 records and Access pops up a
> >>>message saying:
> >>>Microsoft Office Access has encountered a problemand needs to close.
> >>>We are sorry for the inconvenience.
>
> >>>Using Access 2003 over Windows Xp SP3.
>
> >>>Could someone please look at my code and point out as to where I'm
> >>>going wrong ?
>
> >>>Private Sub Form_Current()
>
> >>>    Application.Echo False
> >>>    Dim stFileName As String
> >>>    stFileName = "C:\Al-Maha-Membership\Snaps\" + Me.MembershipNo +
> >>>".jpg"
>
> >>>    If Dir(stFileName) = "" Then
> >>>        'MsgBox "file does not exist"
> >>>        Me.Image_Holder.Picture = ""
> >>>        Me.Lbl_NoPhotoAvailable.Visible = True
> >>>    Else
> >>>        'MsgBox "file does exist"
> >>>        Me.Image_Holder.Picture = "C:\Al-Maha-Membership\Snaps\" +
> >>>Me.MembershipNo + ".jpg"
> >>>        Me.Lbl_NoPhotoAvailable.Visible = False
> >>>    End If
> >>>    Application.Echo True
>
> >>>End Sub
>
> >>>Rgds,
> >>>Prakash.
>
> >>Maybe the pics are huge?  Or you have a lot if them.
>
> >>I created a table. Contains 3 fields; ID, PicName, PicImage.  Ex:
> >>        1
> >>        Picture Of Me
> >>        C:\Pics\Pic1.jpg
>
> >>I created an image field on the form and named it PicImage.  I set the
> >>PictureType to linked, the Picture link blank.
>
> >>Then my code in the OnCurrent is
> >>     Me.PicImage.Picture = Me.PicLink
>
> >>I don't get your message.  Maybe due to fewer pics, maybe smaller size.
> >>  Mine were about 300K.  If your pics are 5 megs in size, maybe try
> >>Irfanview (free program) and from the menu try Image/Resize.- Hide quoted text -
>
> >>- Show quoted text -
>
> > Hi Salad ...
>
> > I have approx 450 images in the folder. They are jpegs and the average
> > size of each is approx 20kb. Largest file is 35kb.
>
> > Someone else had written this membership application earlier and had
> > used a bound object frame control with the photos embedded into it.
> > The table contains approx 500 records and the database size is 1gb.
>
> > I wanted to bring down the database size & so wanted to keep a
> > "linked" image rather than embedding it into the database. And as far
> > as I remember, this is the preferred and advised approach.
>
> > Now when I try to scroll the "bound control" even by holding the mouse
> > down ... the form hiccups (freezes) every 7 to 8 records and then
> > continues scrolling for another say 8 records all the way till the end
> > of the table. But NO CRASHING !! (now, this is with my linked image
> > control disabled). The moment I enable my linked image control, the
> > crash comes up. This is very frustrating.
>
> > Any ideas ??  If it continues like this I may have to deliver the
> > package with the embedded image control (ugh) ... the database is
> > unnecessarily bloated.
>
> > Rgds,
> > Prakash.
>
> I used an Image control.  I did not use and Unbound or Bound Object
> Frame control.  I did not embed the image, but I did try that as well.
>   It didn't seem to make a speed difference since it was updating the
> form's field via the current event, not the table field.
>
> Do you have an old computer?  Or perhaps your computer needs to be
> rebooted?  Or you have barebones memory?- Hide quoted text -
>
> - Show quoted text -

Running the app on an acer laptop (yes a lil old) ... specs are:
Intel Pentium M 725 processor, 512MB RAM
newly formatted last week ... no antivirus insalso as yet - so
resources are available.

If you feel these are low resources, I'll try it on a faster laptop I
have Core2Duo 2ghz, 2gb ram running vista. I'll post back after my
trial in a few mins.

Rgds,
Prakash.
From: Prakash on
On Apr 10, 11:23 pm, Prakash <sim...(a)omantel.net.om> wrote:
> On Apr 10, 11:09 pm, Salad <sa...(a)oilandvinegar.com> wrote:
>
>
>
>
>
> > Prakash wrote:
> > > On Apr 10, 10:36 pm, Salad <sa...(a)oilandvinegar.com> wrote:
>
> > >>Prakash wrote:
>
> > >>>I'm using the foll code to display images from a folder on a form.
>
> > >>>Each time I try to scroll to the "next" record a small window flashes
> > >>>past saying:
> > >>>"Importing C:\Al-Maha-Membership\Snaps\FILENAME.jpg"
>
> > >>>1) Why does this appear even though I've specified:   Application.Echo
> > >>>False
>
> > >>>2) If I wait for some time (say 1 sec) between each click to go to the
> > >>>next record there's no problem. However, if I try to scroll fast the
> > >>>program hangs after scrolling say 8 to 10 records and Access pops up a
> > >>>message saying:
> > >>>Microsoft Office Access has encountered a problemand needs to close.
> > >>>We are sorry for the inconvenience.
>
> > >>>Using Access 2003 over Windows Xp SP3.
>
> > >>>Could someone please look at my code and point out as to where I'm
> > >>>going wrong ?
>
> > >>>Private Sub Form_Current()
>
> > >>>    Application.Echo False
> > >>>    Dim stFileName As String
> > >>>    stFileName = "C:\Al-Maha-Membership\Snaps\" + Me.MembershipNo +
> > >>>".jpg"
>
> > >>>    If Dir(stFileName) = "" Then
> > >>>        'MsgBox "file does not exist"
> > >>>        Me.Image_Holder.Picture = ""
> > >>>        Me.Lbl_NoPhotoAvailable.Visible = True
> > >>>    Else
> > >>>        'MsgBox "file does exist"
> > >>>        Me.Image_Holder.Picture = "C:\Al-Maha-Membership\Snaps\" +
> > >>>Me.MembershipNo + ".jpg"
> > >>>        Me.Lbl_NoPhotoAvailable.Visible = False
> > >>>    End If
> > >>>    Application.Echo True
>
> > >>>End Sub
>
> > >>>Rgds,
> > >>>Prakash.
>
> > >>Maybe the pics are huge?  Or you have a lot if them.
>
> > >>I created a table. Contains 3 fields; ID, PicName, PicImage.  Ex:
> > >>        1
> > >>        Picture Of Me
> > >>        C:\Pics\Pic1.jpg
>
> > >>I created an image field on the form and named it PicImage.  I set the
> > >>PictureType to linked, the Picture link blank.
>
> > >>Then my code in the OnCurrent is
> > >>     Me.PicImage.Picture = Me.PicLink
>
> > >>I don't get your message.  Maybe due to fewer pics, maybe smaller size.
> > >>  Mine were about 300K.  If your pics are 5 megs in size, maybe try
> > >>Irfanview (free program) and from the menu try Image/Resize.- Hide quoted text -
>
> > >>- Show quoted text -
>
> > > Hi Salad ...
>
> > > I have approx 450 images in the folder. They are jpegs and the average
> > > size of each is approx 20kb. Largest file is 35kb.
>
> > > Someone else had written this membership application earlier and had
> > > used a bound object frame control with the photos embedded into it.
> > > The table contains approx 500 records and the database size is 1gb.
>
> > > I wanted to bring down the database size & so wanted to keep a
> > > "linked" image rather than embedding it into the database. And as far
> > > as I remember, this is the preferred and advised approach.
>
> > > Now when I try to scroll the "bound control" even by holding the mouse
> > > down ... the form hiccups (freezes) every 7 to 8 records and then
> > > continues scrolling for another say 8 records all the way till the end
> > > of the table. But NO CRASHING !! (now, this is with my linked image
> > > control disabled). The moment I enable my linked image control, the
> > > crash comes up. This is very frustrating.
>
> > > Any ideas ??  If it continues like this I may have to deliver the
> > > package with the embedded image control (ugh) ... the database is
> > > unnecessarily bloated.
>
> > > Rgds,
> > > Prakash.
>
> > I used an Image control.  I did not use and Unbound or Bound Object
> > Frame control.  I did not embed the image, but I did try that as well..
> >   It didn't seem to make a speed difference since it was updating the
> > form's field via the current event, not the table field.
>
> > Do you have an old computer?  Or perhaps your computer needs to be
> > rebooted?  Or you have barebones memory?- Hide quoted text -
>
> > - Show quoted text -
>
> Running the app on an acer laptop (yes a lil old) ... specs are:
> Intel Pentium M 725 processor, 512MB RAM
> newly formatted last week ... no antivirus insalso as yet - so
> resources are available.
>
> If you feel these are low resources, I'll try it on a faster laptop I
> have Core2Duo 2ghz, 2gb ram running vista. I'll post back after my
> trial in a few mins.
>
> Rgds,
> Prakash.- Hide quoted text -
>
> - Show quoted text -


Ok. Tried it on the Core2Duo Laptop. Just cannot get it to crash.
That's running VIsta and Office 2007. Try as I might, it would hiccup
and jerk while scrolling but it refused to crash. I now need to try it
on another fast PC with sufficient resources but running XP and Off
2003. Can do that tomorrow morning only.

1 more thing ... from what I've noticed, the bound bound object frame
control loads the image a fraction of a second faster than the image
control. Is my modus operandi correct i.e. by using a linked image
rather than an embedded one ?

Any other ideas & advice ?

In the meanwhile I'll try this app tomo morn on another PC running XP/
off2003 & post my findings.

Rgds,
Prakash.
From: Sky on
>
> Ok. Tried it on the Core2Duo Laptop. Just cannot get it to crash.
> That's running VIsta and Office 2007. Try as I might, it would hiccup
> and jerk while scrolling but it refused to crash. I now need to try it
> on another fast PC with sufficient resources but running XP and Off
> 2003. Can do that tomorrow morning only.
>
> 1 more thing ... from what I've noticed, the bound bound object frame
> control loads the image a fraction of a second faster than the image
> control. Is my modus operandi correct i.e. by using a linked image
> rather than an embedded one ?
>
> Any other ideas& advice ?
>
> In the meanwhile I'll try this app tomo morn on another PC running XP/
> off2003& post my findings.
>
> Rgds,
> Prakash.

You might try adding this to your registry:

HKLM\SOFTWARE\Microsoft\Shared Tools\Graphics Filters\Import\JPEG\Options

ValueType: string

ValueName: ShowProgressDialog

ValueData: No

In the above, the SubKey should not be wrapped, it is all one line.

Steve