Hi,
I am quite new in VB and am quite ashamed to ask this actually but it is keeping me busy for two weeks now. Any help would be most appreciated!!! thanks in advance!
I have a form with a button that when it is pressed it automatically scans an image (code is from bits and pieces of the net) to a specific folder. When the image is stored the directory of that image is stored in a table named "Factuur" and column named "PictureLink3" . Now everything works fine except that the image directory is always appended at the end of the column and not in the field of the current record the form is showing...
I tried the update statement as well but it says there is no record selected...
I am quite new in VB and am quite ashamed to ask this actually but it is keeping me busy for two weeks now. Any help would be most appreciated!!! thanks in advance!
Code:
Private Sub Command69_Click()
Dim sFile As String
Dim mydevice As WIA.Device
Dim item As WIA.item
Dim imfile As WIA.ImageFile
Dim Commondialog1 As WIA.CommonDialog
Dim myDB As Database
Set myDB = OpenDatabase("C:\Documents and Settings\Tom\Documents\5_Personallia\project1.accdb")
sFile = ("C:\Documents and Settings\Tom\Documents\5_Personallia\fotoos\Photo1.jpg")
sFile = IncrementFileName(sFile)
myDB.Execute "Insert into Factuur (PictureLink3) VALUES ('" & sFile & "')"
Set Commondialog1 = New CommonDialog
Set imfile = Commondialog1.ShowAcquireImage(, , , wiaFormatJPEG)
If imfile Is Nothing Then
MsgBox "Action aborted"
Else
imfile.SaveFile (sFile)
End If
Exit_Command0_Click_click:
Set mydevice = Nothing
Set item = Nothing
Exit Sub
Err_Command0_Click_click:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error Taking Picture"
Resume Exit_Command0_Click_click
End Sub
I tried the update statement as well but it says there is no record selected...