Importing Images To Form

  • Thread starter Thread starter Jerome
  • Start date Start date
J

Jerome

I want to be able to import and attach a scanned image
file to a record in a table. When the result is queried i
want the option to open the attached file associated with
that record. is this possible? Thank you...
 
There are a few things you need to do to accomplish this...

There needs to be a field in the table your form is bound to with th
directory path for each image. I am assuming that for each record ther
is a specific image associated with it. Make a new column and poplulat
that field with the appropriate information.


Add an image field bound to the field in your table (click the imag
icon in the toolbar, then click and drag the field name from the fiel
list to your form. A dialog box will appear asking you where th
picture is located. Navigate to the location of your images and choos
the first image.

Double click the form selector to bring up the properties of the for
and go to the on current property and choose code builder. Enter th
following code: The image contral name is the name of the image contro
on your form and the image path is the name of the field on your for
that has the directory path for your images.

Private Sub Form Current()
On Error Resume Next
Me![ImagecontrolName].picture = Me![ImagePath]
End Sub

Next, click on the control that is bound to the text field containin
the location of the images and click the properties button. Click th
build button on the AfterUpdate property and enter the same code a
above using the same information as above.

That should do the trick. If you are still having problems, if you us
the help menu, it gives a pretty good explanation of what I just tol
you...

Good luck!!
 
There are a few things you need to do to accomplish this...

There needs to be a field in the table your form is bound to with th
directory path for each image. I am assuming that for each record ther
is a specific image associated with it. Make a new column and poplulat
that field with the appropriate information.


Add an image field bound to the field in your table (click the imag
icon in the toolbar, then click and drag the field name from the fiel
list to your form. A dialog box will appear asking you where th
picture is located. Navigate to the location of your images and choos
the first image.

Double click the form selector to bring up the properties of the for
and go to the on current property and choose code builder. Enter th
following code: The image contral name is the name of the image contro
on your form and the image path is the name of the field on your for
that has the directory path for your images.

Private Sub Form Current()
On Error Resume Next
Me![ImagecontrolName].picture = Me![ImagePath]
End Sub

Next, click on the control that is bound to the text field containin
the location of the images and click the properties button. Click th
build button on the AfterUpdate property and enter the same code a
above using the same information as above.

That should do the trick. If you are still having problems, if you us
the help menu, it gives a pretty good explanation of what I just tol
you...

Good luck!!
 
Back
Top