×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

image's control source

image's control source

image's control source

(OP)
Hi folks. Any help is appreciated.

I'm trying to change the control source of an image in the VBA however it doesn't show up in the list/properties dropdown when I type in me.imgNarrative. The Control Source exists in the properties window on the form just not in the VBA.

Any clues as to why this is doing this?

Thanks

-Nima
"Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity" aka K.I.S.S. (Keep It Short and Simple) -- Ockham's Razor

RE: image's control source

(OP)
I'm using Access 2010.

-Nima
"Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity" aka K.I.S.S. (Keep It Short and Simple) -- Ockham's Razor

RE: image's control source

(OP)
So after some research it turns there's no Control Source for the vba! How can this be? What do you do when you have to change the control source to point to another field in a table? Am I crazy? What's going on?

banghead

-Nima
"Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity" aka K.I.S.S. (Keep It Short and Simple) -- Ockham's Razor

RE: image's control source

I played with this and could not figure out a way to do this. The control source for the image control was added in Access 2007. Why they did not change the object model I do not know. could you fake this by adding a hidden image control? Then switch between the two making the hidden visible and the current invisible.

RE: image's control source

LARiot,
You haven't suggested what happened when you simply ignored the fact that ControlSource didn't display in the Intellisense and typed it regardless?

I believe the PageBreak control never displayed the Visible property in Intellisense but that didn't prohibit you from using it in VBA.

Duane
Hook'D on Access
MS Access MVP

RE: image's control source

(OP)
Says member or property not found.

-Nima
"Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity" aka K.I.S.S. (Keep It Short and Simple) -- Ockham's Razor

RE: image's control source

What effect are you trying to achieve?

RE: image's control source

(OP)
A record has four images associated with it. Four option buttons on top of the image in the form. When you select one button it should change the source control for that image to point to the corresponding field/column.

-Nima
"Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity" aka K.I.S.S. (Keep It Short and Simple) -- Ockham's Razor

RE: image's control source

Have four bound image controls stacked on top of each other and bound to different fields. Hide all but one. Change which one is the visible control. However, this does not seem very normalized. Seems to me you should have a table of images with a foreign key relating to the record instead of separate fields for each image. Then you could simply scroll through the available records. If the data cannot be permanently normalized you could use a normalizing query with the form.

RE: image's control source

As posted in the other thread the easier solution would be to go back to leave the image control unbound and use code to load it. Example. Assume I have 3 fields: path1, path2, and path3. And have command buttons to change the image. Then simply need some code like

CODE

Private Sub Command1_Click()
  Me.Image0.Picture = Me.path
End Sub

Private Sub Command2_Click()
  Me.Image0.Picture = Me.path2
End Sub

Private Sub Command3_Click()
  Me.Image0.Picture = Me.path3
End Sub 
Need to add error checking for bad paths, and null records.

RE: image's control source

(OP)
Maj:

I'd already thought of that. No go, another M$ bug. Had to code it to change text field in table.

Thanks for lookin' into it.

-Nima
"Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity" aka K.I.S.S. (Keep It Short and Simple) -- Ockham's Razor

RE: image's control source

I have tried that in 2007 and 2010 and works fine. I know of no bug associated with it.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close