By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,490 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,490 IT Pros & Developers. It's quick & easy.

Stuck on images

P: n/a
I am really stumped on coming up with a good solution for this
problem...
I have an Access2K continuous form that has an image field. In a SQL
Server table of appointments is an integer field named ApptType. That
table is joined to the ApptType Field of table also holding an Image
field named ApptIcon.
When the use propulates the continuos form, if ApptType = 1 then Icon
1 is displayes, ApptType = 2 then Icon 2 is displayed, etc.
The icons are very small 32x32 pixels, but it is very slow over slow
connections.
I am hoping someone can give me a better way to do this or perhaps a
way to speed up what I'm doing...
Help is greatly appreciated.
lq
Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Lauren,

Are you storing the bitmap as an embedded object?
If so, I'd suggest using an unbound image frame instead, then use code to
assign the .Picture Property using a stored path string.
In the code below, the "Me![ImageFrame].Picture" property is set to the
contents of a bound field named ImagePath.
======================================
Private Sub Form_Current()
On Error Resume Next

If Me![ImagePath] <> "" Then
Me![ImageFrame].Picture = Me![ImagePath]
Else
Me![ImageFrame].Picture = ""
End If

Me.Refresh

End Sub
======================================
Or in your case, you might want this (and this is "aircode"):
======================================
Private Sub Form_Current()

Dim MyPath as String
Dim IconType as Long ' Or Integer?

MyPath = "C:\Icons\Icon"
IconType = Me![ApptType]

If IconType <> "" Then
Me![ImageFrame].Picture = MyPath & IconType & ".jpg"
'eg Me![ImageFrame].Picture = "C:\Icons\Icon1.jpg" or
Me![ImageFrame].Picture = "C:\Icons\Icon2.jpg", etc.
Else
Me![ImageFrame].Picture = "" 'If ApptType is blank, don't display any
picture at all.
End If

Me.Refresh

End Sub
======================================

*** Hmmm....waitasec... you said continuous forms... this probably wont work
for that, sorry. :-(
All records will likely show the same icon in a continuous form.

However....If you only need to have this image displayed in a printed report
.... I know it will work there, using the On Format event.
--
HTH,
Don
=============================
Use My*****@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.
=============================
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
I am really stumped on coming up with a good solution for this
problem...
I have an Access2K continuous form that has an image field. In a SQL
Server table of appointments is an integer field named ApptType. That
table is joined to the ApptType Field of table also holding an Image
field named ApptIcon.
When the use propulates the continuos form, if ApptType = 1 then Icon
1 is displayes, ApptType = 2 then Icon 2 is displayed, etc.
The icons are very small 32x32 pixels, but it is very slow over slow
connections.
I am hoping someone can give me a better way to do this or perhaps a
way to speed up what I'm doing...
Help is greatly appreciated.
lq

Nov 12 '05 #2

P: n/a
tom
Lauren,

One guess: it sounds like your appointment type table may be a
relatively small lookup sort of table. Might it be helpful to copy the
whole contents of the table locally, to a temporary Jet database, when
the application launches? That way, you don't have to pull bitmaps
through the wire for every record, especially when it sounds like it's
often the same image. If you link to the table (is this an adp or a
regular access database?), you should still be able to make a query
that joins the Appointment table to your temporary AppointmentType
table. Big caveat: this is a complete guess... I haven't worked with
bound images in Access.

-Tom
la*************@hotmail.com (Lauren Quantrell) wrote in message news:<47**************************@posting.google. com>...
I am really stumped on coming up with a good solution for this
problem...
I have an Access2K continuous form that has an image field. In a SQL
Server table of appointments is an integer field named ApptType. That
table is joined to the ApptType Field of table also holding an Image
field named ApptIcon.
When the use propulates the continuos form, if ApptType = 1 then Icon
1 is displayes, ApptType = 2 then Icon 2 is displayed, etc.
The icons are very small 32x32 pixels, but it is very slow over slow
connections.
I am hoping someone can give me a better way to do this or perhaps a
way to speed up what I'm doing...
Help is greatly appreciated.
lq

Nov 12 '05 #3

P: n/a
Don,
Thanks for the response. I do in fact do this for all forms that are
not continuous forms and for reports. I am looking for a solution that
will work on a continuous form. It has me stumped.
lq

"Don Leverton" <le****************@telusplanet.net> wrote in message news:<FMBdc.27399$Sh4.6581@edtnps84>...
Hi Lauren,

Are you storing the bitmap as an embedded object?
If so, I'd suggest using an unbound image frame instead, then use code to
assign the .Picture Property using a stored path string.
In the code below, the "Me![ImageFrame].Picture" property is set to the
contents of a bound field named ImagePath.
======================================
Private Sub Form_Current()
On Error Resume Next

If Me![ImagePath] <> "" Then
Me![ImageFrame].Picture = Me![ImagePath]
Else
Me![ImageFrame].Picture = ""
End If

Me.Refresh

End Sub
======================================
Or in your case, you might want this (and this is "aircode"):
======================================
Private Sub Form_Current()

Dim MyPath as String
Dim IconType as Long ' Or Integer?

MyPath = "C:\Icons\Icon"
IconType = Me![ApptType]

If IconType <> "" Then
Me![ImageFrame].Picture = MyPath & IconType & ".jpg"
'eg Me![ImageFrame].Picture = "C:\Icons\Icon1.jpg" or
Me![ImageFrame].Picture = "C:\Icons\Icon2.jpg", etc.
Else
Me![ImageFrame].Picture = "" 'If ApptType is blank, don't display any
picture at all.
End If

Me.Refresh

End Sub
======================================

*** Hmmm....waitasec... you said continuous forms... this probably wont work
for that, sorry. :-(
All records will likely show the same icon in a continuous form.

However....If you only need to have this image displayed in a printed report
... I know it will work there, using the On Format event.
--
HTH,
Don
=============================
Use My*****@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.
=============================
"Lauren Quantrell" <la*************@hotmail.com> wrote in message
news:47**************************@posting.google.c om...
I am really stumped on coming up with a good solution for this
problem...
I have an Access2K continuous form that has an image field. In a SQL
Server table of appointments is an integer field named ApptType. That
table is joined to the ApptType Field of table also holding an Image
field named ApptIcon.
When the use propulates the continuos form, if ApptType = 1 then Icon
1 is displayes, ApptType = 2 then Icon 2 is displayed, etc.
The icons are very small 32x32 pixels, but it is very slow over slow
connections.
I am hoping someone can give me a better way to do this or perhaps a
way to speed up what I'm doing...
Help is greatly appreciated.
lq

Nov 12 '05 #4

P: n/a
Lauren,

I think Tom has a good idea, but it is possible that you can handle it by
only downloading the image files themselves.

If you put them in the same folder in which the application is saved on each
machine, and they are linked, it should be "manageable". Then, in the SQL
server table, use the path to the local image. Caveat: I haven't done it
exactly this way because (fortunately) I did not have to display images in a
continuous forms view forms.

If your table of images changes, you can download it again to refresh the
local table with a little code at startup.

If anyone has a trick to allow you to handle continous forms images without
using Bound OLE, I'd guess it to be MVP Stephen Lebans,
http://www.lebans.com.

Larry Linson
Microsoft Access MVP
"tom" <to*@nuws.com> wrote in message
news:c1**************************@posting.google.c om...
Lauren,

One guess: it sounds like your appointment type table may be a
relatively small lookup sort of table. Might it be helpful to copy the
whole contents of the table locally, to a temporary Jet database, when
the application launches? That way, you don't have to pull bitmaps
through the wire for every record, especially when it sounds like it's
often the same image. If you link to the table (is this an adp or a
regular access database?), you should still be able to make a query
that joins the Appointment table to your temporary AppointmentType
table. Big caveat: this is a complete guess... I haven't worked with
bound images in Access.

-Tom
la*************@hotmail.com (Lauren Quantrell) wrote in message

news:<47**************************@posting.google. com>...
I am really stumped on coming up with a good solution for this
problem...
I have an Access2K continuous form that has an image field. In a SQL
Server table of appointments is an integer field named ApptType. That
table is joined to the ApptType Field of table also holding an Image
field named ApptIcon.
When the use propulates the continuos form, if ApptType = 1 then Icon
1 is displayes, ApptType = 2 then Icon 2 is displayed, etc.
The icons are very small 32x32 pixels, but it is very slow over slow
connections.
I am hoping someone can give me a better way to do this or perhaps a
way to speed up what I'm doing...
Help is greatly appreciated.
lq

Nov 12 '05 #5

P: n/a
Tom,
What you suggest is exactly what I did when it was an access MDB
database and it worked great. All tables containing "static" data were
stored locally, things like tables holding images and rows used to
fill static combo boxes etc. The system worked great. I had a
date/time check against the a datetime field named
"StaticTablesModified" and if the local needed updating it would
update the local tables.
Except, now I'm using an Access2K ADP connected to SQL Server which
does not allow for that scheme.
lq

to*@nuws.com (tom) wrote in message news:<c1**************************@posting.google. com>...
Lauren,

One guess: it sounds like your appointment type table may be a
relatively small lookup sort of table. Might it be helpful to copy the
whole contents of the table locally, to a temporary Jet database, when
the application launches? That way, you don't have to pull bitmaps
through the wire for every record, especially when it sounds like it's
often the same image. If you link to the table (is this an adp or a
regular access database?), you should still be able to make a query
that joins the Appointment table to your temporary AppointmentType
table. Big caveat: this is a complete guess... I haven't worked with
bound images in Access.

-Tom
la*************@hotmail.com (Lauren Quantrell) wrote in message news:<47**************************@posting.google. com>...
I am really stumped on coming up with a good solution for this
problem...
I have an Access2K continuous form that has an image field. In a SQL
Server table of appointments is an integer field named ApptType. That
table is joined to the ApptType Field of table also holding an Image
field named ApptIcon.
When the use propulates the continuos form, if ApptType = 1 then Icon
1 is displayes, ApptType = 2 then Icon 2 is displayed, etc.
The icons are very small 32x32 pixels, but it is very slow over slow
connections.
I am hoping someone can give me a better way to do this or perhaps a
way to speed up what I'm doing...
Help is greatly appreciated.
lq

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.