A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Icons to substitute for text



 
 
Thread Tools Display Modes
  #1  
Old February 21st, 2007, 05:19 PM posted to microsoft.public.access.forms
dapetrella
external usenet poster
 
Posts: 24
Default Icons to substitute for text

I have a db that makes reference to restaurants, hotels, retail shops, etc.
and I want to produce a one page report that shows these items using icons
instead of text for a certain area. Can I do this in Access or do I need to
export to Word?

Thanks.
  #2  
Old February 21st, 2007, 05:39 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default Icons to substitute for text

On Wed, 21 Feb 2007 09:19:00 -0800, dapetrella wrote:

I have a db that makes reference to restaurants, hotels, retail shops, etc.
and I want to produce a one page report that shows these items using icons
instead of text for a certain area. Can I do this in Access or do I need to
export to Word?

Thanks.


If you know the location of the picture bitmap, you should be able to
use some code to select the correct picture.

Add an Image control to the report Detail section.

Code the Detail Format event:

If [Category] = "Restaurant" Then
Me.ImageControlName = "C:\ImageFolder\RestaurantPicture.bmp"
ElseIf [Category] = "Hotel" Then
Me.ImageControlName = "C:\ImageFolder\HotelPicture.bmp"
ElseIf .... etc.
End If
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #3  
Old February 21st, 2007, 06:00 PM posted to microsoft.public.access.forms
dapetrella
external usenet poster
 
Posts: 24
Default Icons to substitute for text

Thanks for the quick reply. I use Yes/No checkboxes instead of text for
these items...How would the code read for this type of substitution?

"fredg" wrote:

On Wed, 21 Feb 2007 09:19:00 -0800, dapetrella wrote:

I have a db that makes reference to restaurants, hotels, retail shops, etc.
and I want to produce a one page report that shows these items using icons
instead of text for a certain area. Can I do this in Access or do I need to
export to Word?

Thanks.


If you know the location of the picture bitmap, you should be able to
use some code to select the correct picture.

Add an Image control to the report Detail section.

Code the Detail Format event:

If [Category] = "Restaurant" Then
Me.ImageControlName = "C:\ImageFolder\RestaurantPicture.bmp"
ElseIf [Category] = "Hotel" Then
Me.ImageControlName = "C:\ImageFolder\HotelPicture.bmp"
ElseIf .... etc.
End If
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

  #4  
Old February 21st, 2007, 07:25 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default Icons to substitute for text

On Wed, 21 Feb 2007 10:00:28 -0800, dapetrella wrote:

Thanks for the quick reply. I use Yes/No checkboxes instead of text for
these items...How would the code read for this type of substitution?

"fredg" wrote:

On Wed, 21 Feb 2007 09:19:00 -0800, dapetrella wrote:

I have a db that makes reference to restaurants, hotels, retail shops, etc.
and I want to produce a one page report that shows these items using icons
instead of text for a certain area. Can I do this in Access or do I need to
export to Word?

Thanks.


If you know the location of the picture bitmap, you should be able to
use some code to select the correct picture.

Add an Image control to the report Detail section.

Code the Detail Format event:

If [Category] = "Restaurant" Then
Me.ImageControlName = "C:\ImageFolder\RestaurantPicture.bmp"
ElseIf [Category] = "Hotel" Then
Me.ImageControlName = "C:\ImageFolder\HotelPicture.bmp"
ElseIf .... etc.
End If
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


I'm glad you posted back. I see I left off the property of the Image
control that you had to change. It should have read:
Me.ImageControlName.Picture = "C:\ImageFolder\RestaurantPicture.bmp"
etc.

I've fixed it below.

Check boxes? Hopefully you mean Check boxes used within an Option
Group.
If you do have individual check boxes bound to separate fields in the
table ....

If [CheckRestaurant] = True Then
Me.ImageControlName.Picture = "C:\ImageFolder\RestaurantPicture.bmp"
ElseIf [CheckHotel] = True Then
Me.ImageControlName.Picture = "C:\ImageFolder\HotelPicture.bmp"
ElseIf .... etc.
End If

That's not a good design as it's possible to have more than one check
box checked.

If the check box is within an option group (Better design. Only one
can be checked.):

If Me.[OptionGroupName] = 1 then
Me.ImageControlName.Picture = "C:\ImageFolder\RestaurantPicture.bmp"
ElseIf Me.[OptionGroupName] = 2 Then
Me.ImageControlName.Picture = "C:\ImageFolder\HotelPicture.bmp"
ElseIf .... etc.
End If

I'm assuming you only have a half dozen or so items. If you have many,
look up Select Case in VBA help. It's a bit easier to follow if you
have lot's of options.


--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.