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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display image using combo box 1

Status
Not open for further replies.

instructorTek

Instructor
Jun 5, 2006
61
0
0
Hi all I need some help with this. I'm creating a form to allow a user to build their own computer. When the user chooses an item on the combo box the image changes according to the item chosen. e.g if they choose a case the specific image shows up next to it. I can't get the image to change according to the combo box choice. I have a table with the paths to the images:
This did not work. Any help will be appreciated.
Private sub combo_AfterUpdate()
me![imageObject].Picture = me![comboQuery]![imagePath]
End sub
 
Have a look at the Column property of the ComboBox object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi I looked at the column properties. I only saw Column Count,Column Heads and Column Widths unfortunately I don't see how any of these can help. I would like the image to change according to the selected value in the combo box.
 
What is the actual SQL code of the RowSource ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi instructor,

Does
Code:
me![imageObject].Picture = me![comboQuery]![imagePath]
me.refresh
help?

Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
 
Hi PHV the SQL code for the RowSource of the combo box is:
SELECT qryCombo.StockId,qryCombo.CategoryId,qryCombo.picture FROM qryCombo;

Hi Darrylles, when I used the code you provided, I got the same error as I got before as soon as i select a combo box option i.e. 'Run-time error 2465. Microsoft Access can't find the field '|'referred to in your expression.

Any help will be most welcomed.

 
Perhaps this ?
Me![imageObject].Picture = Me![comboQuery].Column(2)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
When I select a combo box option I'm getting the error:
'Run-time error 2465. Microsoft Access can't find the field 'comboQuery'referred to in your expression.
 
What is the name of the combo ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
So, you may try this:
Me![imageObject].Picture = Me![cboItem].Column(2)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks so much PHV it worked as your code always do. I'm curious what does column(2) do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top