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 said:
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
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.