LOADING A PICTURE INTO A PICTURE BOX IN A FORM, BROWSING THROUGH A DIRECTORY
Posted on 2003-03-10
I am trying to load a picture in a form by browsing through a directory and selecting a picture and am trying to store it in an image or picture box in a from. I then want this to be stored here, with the name of the file stored in an MS ACCESS Field. I have entered the following code below but it doesnt work.
Private Sub cmdStallionPicture_Click()
Dim intFile As Integer
Dim NewFile As Picture
On Error GoTo ErrHandler
cdbDialog1.Filter = "JPG(*.JPG)|*.JPG"
cdbDialog1.FilterIndex = 1
cdbDialog1.InitDir = "C:\Forest View Stud Farm DBMS\Images\Stallions\"
NewFile = cdbDialog1.FileName
intFile = FreeFile
Open NewFile For Input As intFile
imgStallionPicture.Picture = Input(LOF(intFile), intFile)