Photos on a form

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

I am havind a difficult time understanding this, for some reason. I'd
like to have the photos chosed on a form, then the path stored in a
text field on a table, then when printing a report, the picture would
be on it. here is a good explaintion I found, but no answer on it, any
help would be greatly appricated.

You can store the pictures in a directory and store the path in Access
using text or memo datatype. By doing this you can save lot of space.
For Ex: While creating a form, add a text box and a command button.
When you click on the command button, this should open an open dialog
box with the folder containing pictures. Click on the picture and the
path should appear on the text box. Store this path in the database.
But for this you need to code.
Hope this helps. Because I have tried the same thing in Access and it
worked fine for me.



Thanks
 
here is some sample code:
' do this in the on format event of the details section
Dim DIRVAL As String
Dim PictureNum As String
PictureNum = Trim(STOCKNUMBER)
If PictureNum Like "*,1*" Then
PictureNum = Left(PictureNum, Len(PictureNum) - 3)
End If
Const path = "\\Quantum\Painless\PICTURES\"
DIRVAL = Dir$(path & PictureNum & ".BMP")
If Not DIRVAL = "" Then
' Here is what you need to know, pic is the reports unbound control
Me.Pic.Picture = path & PictureNum + ".bmp"
Me.Pic.Visible = True
Else
Me.Pic.Picture = path & "sorry.bmp"
Me.Pic.Visible = True
End If
 
Back
Top