Link to home
Start Free TrialLog in
Avatar of sturobinson17
sturobinson17

asked on

:-( elp

When i scroll threw the records in my database i want a different picture to load for each record. How do i do it?
Avatar of kiprimshot
kiprimshot

I would store the image path and display the image in and image control...but there may be an easier way.

Me.imgControl.Picture = strImagePath(recordsetvalue)
Can't you just insert a picture from the insert>object command into a bound object frame linked to a picture (OLE object) field in the table?
the easy way is to insert the picture itself.
But Access does no thandle graphics to well. The database will bloat pretty rapidly. (try it out, it can grow immense)

Kiprimshot is the effective way to handle that problem.

cheers
Ricky
Hi sturobinson17,

To scroll through a list of records and display a picture for each one you have to set the picture as an OLE (object linked embedded) field.

1. Firstly, in the table for the particular form, enter a fieldname called ?Picture? and choose the data type ?OLE Object?.

2. Next, open up the particular form in Design View and click on the Field Chooser button. Drag the fieldname you have just created called ?Picture? onto the form.

3. A blank frame should then appear. Give the label attached to it a suitable name.

4. Open the form in Form View. Place your cursor in the blank frame. Next, click on INSERT on the menu bar and select the option ?Object?. This is where you embed a picture to each record.

5. A box will then appear asking you to browse for the object you are embedding on your form. Click on ?Create from file? and select the BMP you are attaching to this particular record by clicking Browse and choosing its location on your hard drive.

6. Once you have chosen the BMP, click OPEN then OK.

7. The picture will then be embedding onto the form for that record. Repeat stages 4-6 for each record.

Hope this helps.

AMP81
Avatar of sturobinson17

ASKER

sounds good amp81, i'll give it a go. One more thing. Can i save the database as an application? or would i need to use Access to run the database no matter what. I have Visual Basic if thats any good.
Hi sturobinson17,

the instructions I gave you were created using a database created in MS Access 97.

Could you be abit more specific as to what you mean? Do you mean will you need to run Access 97 to open the database? If so, my instructions will work.

Did the OLE work ok on your form?

AMP81
not had the chance to try the ole yet, will do 2night. I'm using Access 2000 to do this. But the place that i'm doing it for has access 97 which can't open 2000 files. Can i make it into an application so they wouldnt need access? i've done a lot of work on it, and it would take too long to re do in 97.
Right I'll explain the situation in more detail, which i should have done in the first place.

I'm making a DAtabase for a golf course. On one of the forms, I want to have the memner details, and possible link this to a "member game" form. So i can display information from both forms as 1 form. And in the member game form i want to have a summary for each hole they have played on. So i would like to have a picture for each hole, i have drawn them all and saved them as bitmaps. When i tried you're suggestion amp81, the best i could get was a thumb nail with the file name under it. Am i doing something wrong?
Hi,

Sounds to me like its not linking to the picture correctly if all you can see is a thumbnail.

Have you made the frame for the picture bigger enough to display the BMP? If not, enter the form in Design View and enlarge the frame.

Also, just check to make sure that the OLE field is linking to the correct destination of the BMPs for each record. I've kept mine in the same folder as the database. Check to make sure the picture's file type is correct too ie..BMP.

Let me know how you get on.

AMP81

ASKER CERTIFIED SOLUTION
Avatar of cjswimmer
cjswimmer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
how do i do that? I'd like to learn how to do that. Bit of a newby. WEll, i have done a bit of access, but only recently going into more depth.
place an Image control on the form and in the OnCurrent event in your form you should have the code:

ImageControl1.Picture = Me.txtFilePath.Value

where ImageControl1 is the name of the Image control and txtFilePath is the name of a (hidden) textbox bound to the field that contains the full path of the image file.
Hi,

Just to add my 2 cents.  I agree entirely with cjswimmer's recommendation about storing the path instead of the image.

Kne
i dont really understand. whats this field that i have to bind with the text box? can u pretend i'm 7 and explain? lol. If you're not too busy.
It is just a text field.  The value of the field could be something like:

C:\Images\Jpeg\picture1.jpg

now you can place a hidden textbox on you form and call it something like txtFilePath.  In my last post, I stated that you should place an Image control.  If you call this control ImageControl1, then in the OnCurrent event of your form, you should have the code:

ImageControl1.Picture = Me.txtFile1Path.Value
typo:
ImageControl1.Picture = Me.txtFilePath.Value
decided to go with cjswimmer's idea. ssorry about the wait.

regards...
Stu
thanx,

regards...
Stu