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

Picture Control

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
US
Does anyone know how to refer to an image control on a form from a basModule. I need to know how to refer to an image in a form when I'm running code outside of that form.

Example:
Form Name: "Customers"
Image control: imgCustomer




Code Module

Forms!Customers.?????

the ???? also needs to dynamic. I need to pass in the image control name.
 
This works.

Dim frm as Form
Set frm = Forms!Form1
frm.imgCustomer.Picture = "C\My Documents\image6.jpg"

From a module, this sets the Picture property in imgCustomer to the path shown.

Hope this helps.

Paul
 
Thanks for responding. I've gotten this far ,but what I need is to set imgCustomer dynamically. How do you refer to imgCustomer dynamically in code?
 
Sorry, I must not understand what you mean by set imgCustomer dynamically. What do you mean by dynamically? Or maybe better yet, what are you trying to do if you can set imgCustomer dynamically?

Paul
 
Situation.
I have 50 Forms. Each of the Forms has a tab control with 1-15 tabs or individual pages. Each of the pages has an image control that has been placed on the tab using the CreateControl(formname, controltype[, section[, parent[, columnname[, left[, top[, width[, height]]]]]]]). I have some code that iterates through the form and reads all the image control names into an array. Since I'm dealing with lots of forms and controls and "Code management" I have a Database Module instead of a Form module that I'm attempting to use to load the image controls picture property. I need to get like an index to the image control something like
frm.ImageControls(i).Picture = "C:\Documents and Settings\dharris\Desktop\test.gif".



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top