Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking pictures to forms based on certain data values

Status
Not open for further replies.
Jun 17, 2002
23
0
0
US
I have an Access form which we use to input contact information for various people in our marketing database. Each of these clients falls into a certain category which is recorded by clicking one box in the "Contact Type" group options box. The selections are stored as numeric data in a field called "Contact Type". For example if they are a Grape company (we are in agricuture) we click the grape box and so on. What I would like to do is display a small picture at the top of the form showing grapes or potatoes depending upon what type of client is entered. OK, it's really not essential, but I have become somewhat obsessed with the task. Thanks in Advance.
 
Use the _AfterUpdate property of the Client Type box to load the appropriate file source of the picture into the picture object control. Then, update the picture object control.

Sub <client_type_control>_AfterUpdate
Dim strPictureFile as String
if me.<client_type_control>.Value = 1 then
strPictureFile = <Full path and filename AS STRING>
else
... as above with other file
endif
me.<picture_object_control>.Picture=strPictureFile
me.<picture_object_control>.requery
end sub

For many pictures or many types, you could use a CASE SELECT routine instead.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top