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

Can't display/modify picture

Status
Not open for further replies.

jwalz

Programmer
Oct 31, 2000
78
US
Please help! I have a set of parts that have different pictures associated with them. I want to display them with the part record. HOWEVER, I can't get the image to change with the corresponding file stored in the part record. the code executes but the value for the .Picture property necer changes. Here is my code. Can anyone point out what I am doing wrong?

Private Sub Form_Current()
On Error Resume Next
fname = Me.ImageFile
Me![ImageFrame].Picture = fname
End Sub

The variable fname reflects the correct value, but after the assignment statement, Me![ImageFrame].Picture is still Null.

Thanks,
Janet
 
Have you tried looking at the sample database Northwinds that comes with Access. It does exactly what you are attempting to do. Reviewing what has been done there should be most helpfull.

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
I did look at the Northwinds database, thanks. It looks like my problem is related to the fact that it wants the full drive-based path rather than a relative path name. I don't want to force a specific drive letter and would rather use the relative path (IE: picture file lives in a sub-directory off of the database directory) Is there an easy way to determine what the directory path that the current user is using to get to the database?

Thanks, Janet
 
Janet,

A comment ....... it is not a good choice to make by storing the pictures in the database itselt. Doing so will cause it to become extremely large.
I don't know the answer to the use of a relative path. I would think, as you indicate, to store the pictures in some directory. If you have your db split where one end is on a network, that is where I would store the pictures. Therefore, no matter who is using the db, you will always be referring to the drive letter on the network.

Although an exact answer to a question may, in general, work, it may not work for you specifically.

What if you don't have a network or a split db?? (this is a rhetorical question)

Hope this makes some sense.

Maurie

An investment in knowledge always pays the best dividends.

by Benjamin Franklin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top