nagarjuvnc
New member
- Local time
- Today, 05:20
- Joined
- Nov 27, 2018
- Messages
- 9
Hello every one.
I am new to this forum.
I want a help about the following topic
I have made an access project in Microsoft access 2003
Operating system is Windows 10 64 bit
I want capture pictures from a web cam from ms access forms and save it to desired folder.
With the following code I succeeded in Operating System Windows XP. Private Sub btnTakePicture_Click()
Dim tempfile As String
Dim mydevice As WIA.Device
Dim item As WIA.item
Dim imfile As WIA.ImageFile
'Dim Commondialog1 As WIA.CommonDialog
fileName = Loantype & AccountNumber & ".jpg"
tempfile = "D:\P" & fileName 'put the path and name for the location of your temp file here.
'the next 4 lines deletes the old temp file if it exists
Set filesystemobject = CreateObject("Scripting.FileSystemObject")
If filesystemobject.FileExists(tempfile) Then
Kill (tempfile)
End If
'Set Commondialog1 = New CommonDialog
Set imfile = CommonDialog4.ShowAcquireImage
If imfile Is Nothing Then
'MsgBox "Action aborted"
Else
imfile.SaveFile (tempfile) 'this line saves the picture to a specified file
Me.Image1.Picture = (tempfile) 'this sets the picture on the form to show the new picture
End If
Exit_btnTakePicture_click:
Set mydevice = Nothing
Set item = Nothing
Exit Sub
Err_btnTakePicture_click:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error Taking Picture"
Resume Exit_btnTakePicture_click
End Sub
Present in this OS Windows 10, I am unable to run this code
Please help me
I am new to this forum.
I want a help about the following topic
I have made an access project in Microsoft access 2003
Operating system is Windows 10 64 bit
I want capture pictures from a web cam from ms access forms and save it to desired folder.
With the following code I succeeded in Operating System Windows XP. Private Sub btnTakePicture_Click()
Dim tempfile As String
Dim mydevice As WIA.Device
Dim item As WIA.item
Dim imfile As WIA.ImageFile
'Dim Commondialog1 As WIA.CommonDialog
fileName = Loantype & AccountNumber & ".jpg"
tempfile = "D:\P" & fileName 'put the path and name for the location of your temp file here.
'the next 4 lines deletes the old temp file if it exists
Set filesystemobject = CreateObject("Scripting.FileSystemObject")
If filesystemobject.FileExists(tempfile) Then
Kill (tempfile)
End If
'Set Commondialog1 = New CommonDialog
Set imfile = CommonDialog4.ShowAcquireImage
If imfile Is Nothing Then
'MsgBox "Action aborted"
Else
imfile.SaveFile (tempfile) 'this line saves the picture to a specified file
Me.Image1.Picture = (tempfile) 'this sets the picture on the form to show the new picture
End If
Exit_btnTakePicture_click:
Set mydevice = Nothing
Set item = Nothing
Exit Sub
Err_btnTakePicture_click:
MsgBox Err.Description, vbOKOnly + vbCritical, "Error Taking Picture"
Resume Exit_btnTakePicture_click
End Sub
Present in this OS Windows 10, I am unable to run this code
Please help me