NickBridgens
Registered User.
- Local time
- Today, 13:15
- Joined
- Nov 29, 2001
- Messages
- 13
I want to scan an image and store it alongside the record. That bit's ok. I've got a button that launches the scanner and saves the image with a filename as a variant on the record number (so it's unique).
I've got some other code so that the resultant image shows on the form.
I'm also looking at a recent post about BLOBs as being a better way of linking images.
However, I have two scan devices, a scanner and a camera. If I go into Kodak Imaging and select source, quit, launch the form with the scan button on it, it uses the device I just selected. How can I do the selection from Access?
Private Sub Scan_Click()
On Error GoTo Err_Scan_Click
Dim TargetFileName, Response
TargetFileName = (Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)))) + "drw" + String(5 - Len(LTrim(Str(Me.QuoteDetailID))), "0") & LTrim(Str(Me.QuoteDetailID)) + ".jpg"
ImgScan1.ScanTo = FileOnly 'Scan to a file
ImgScan1.Image = TargetFileName
Response = MsgBox("Do you want the scan dialog box?", vbYesNo, "Scan Dialog Box")
If Response = vbYes Then
ImgScan1.ShowSetupBeforeScan = True
Else
ImgScan1.ShowSetupBeforeScan = False
End If
ImgScan1.FileType = 6 'JPEG
ImgScan1.StartScan
Me.ImageLink = TargetFileName
Exit_Scan_Click:
Exit Sub
Err_Scan_Click:
MsgBox Err.Description, , "Scan Error"
End Sub
Cheers
Nick Bridgens
..an accident waiting to happen
I've got some other code so that the resultant image shows on the form.
I'm also looking at a recent post about BLOBs as being a better way of linking images.
However, I have two scan devices, a scanner and a camera. If I go into Kodak Imaging and select source, quit, launch the form with the scan button on it, it uses the device I just selected. How can I do the selection from Access?
Private Sub Scan_Click()
On Error GoTo Err_Scan_Click
Dim TargetFileName, Response
TargetFileName = (Left(CurrentDb.Name, Len(CurrentDb.Name) - Len(Dir(CurrentDb.Name)))) + "drw" + String(5 - Len(LTrim(Str(Me.QuoteDetailID))), "0") & LTrim(Str(Me.QuoteDetailID)) + ".jpg"
ImgScan1.ScanTo = FileOnly 'Scan to a file
ImgScan1.Image = TargetFileName
Response = MsgBox("Do you want the scan dialog box?", vbYesNo, "Scan Dialog Box")
If Response = vbYes Then
ImgScan1.ShowSetupBeforeScan = True
Else
ImgScan1.ShowSetupBeforeScan = False
End If
ImgScan1.FileType = 6 'JPEG
ImgScan1.StartScan
Me.ImageLink = TargetFileName
Exit_Scan_Click:
Exit Sub
Err_Scan_Click:
MsgBox Err.Description, , "Scan Error"
End Sub
Cheers
Nick Bridgens
..an accident waiting to happen