Problem displaying a picture Access 2002

S

SoniaC

I am trying to display a picture in a form without storing the pictures in the table.

I followed the instructions in the help file for this procedure that come in the help access but something is not working. The ImagePath Text field will change from record to record when I select the record at the combo box linked to the form, but the picture is not changing at all.

I did everything following the help file as follow:

"To display pictures that change from record to record without storing them in a table, create a text field to store the locations of the image files. You must store the locations of the pictures in a text field if you want to display the pictures in a data access page. You can also use a text field to store the location of pictures and then use those pictures in a form or report, but you must use Visual Basic event procedures to display the pictures. "

Then I add the event procedure as follow, where ImageControlName is Image13 and ImagePath is ImagePath and the path to the picture is the path for the first record in the list (F:\Converted Files\10301.JPG), then:
1.. If the field list isn't displayed, click Field List on the toolbar.
2.. From the field list, drag the field that contains the locations of the pictures to the form or report.
3.. In the toolbox, click the Image tool .
4.. On the form or report, click where you want to place the object.
5.. In the Insert Picture dialog box, specify the path to any picture, and then click OK. For example, you can type the path to the picture for the first record.
6.. Double-click the form selector or the report selector to open the property sheet.
7.. Click the Build button next to the OnCurrent property box, and then click Code Builder in the Choose Builder dialog box.
8.. Create the following event procedure. Substitute the name of the image control on your form or report for ImageControlName and the name of the control containing the path for ImagePath.
Private Sub Form_Current()On Error Resume NextMe![ImageControlName].Picture = Me![ImagePath]End Sub9.. On the File menu in the Visual Basic Editor, click Close and return to Microsoft Access.
10.. Click the control that is bound to the text field containing the location of the pictures, and then click Properties on the toolbar to open the property sheet..
11.. Click the Build button next to the AfterUpdate property box, click Code Builder in the Choose Builder dialog box, and create the following event procedure. Substitute the name of the image control on your form or report for ImageControlName and the name of the control containing the path for ImagePath.
Private Sub ImagePath_AfterUpdate()On Error Resume NextMe![ImageControlName].Picture = Me![ImagePath]End SubThis event procedure enables you to add or change a picture location in Form view.

12.. On the File menu in the Visual Basic Editor, click Close and return to Microsoft Access.

Please help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top