Thank you for all the advice on this previously but now I need some more. I have been working with theDBguyCollectSignatureDemoV1.0 form theDBGUY, obviously, and I want to save the sig.gif as a file in another folder and keep them that way rather than have them in a table. I can't seem to figure out how to do this. So here's his code.
Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset2
Dim bytArray() As Byte
Dim lngFile As Long
Dim lngCounter As Long
Dim strFile As String
'save signature to table
If Me.Inksignature.Ink.Strokes.Count > 0 Then
'Me.DateSigned = Date
bytArray = Me.Inksignature.Ink.Save(IPF_gif, IPCM_Default)
'either save signature binary data
Me.SignatureData = bytArray
If Me.Dirty Then Me.Dirty = False
'or save signature image data
strFile = "
\\cnh1\wic\rldb\securitas\signatures\sig_" & Me.VName & "_" & ".gif"
'lngFile = FreeFile
Open strFile For Binary Access Write As #lngFile
For lngCounter = 0 To UBound(bytArray)
Put #lngFile, , bytArray(lngCounter)
Next
Close #lngFile
Set rs1 = Me.Recordset
rs1.Edit
Set rs2 = rs1.Fields("SignatureFile").Value
With rs2
If .RecordCount > 0 Then
.Delete
End If
.AddNew
.Fields("FileData").LoadFromFile strFile
.Update
.Close
End With
rs1.Update
rs1.Close
'cleanup
'Set rs2 = Nothing
'Set rs1 = Nothing
'If Dir(strFile) <> "" Then
'Kill strFile
'End If
End If
DoCmd.Close acForm, Me.name
I modified this line from the original
strFile = "
\\cnh1\wic\rldb\securitas\signatures\sig_" & Me.VName & "_" & ".gif"
to reflect the location and name I want to save the signature as however I get an error. What am I missing? A bit more info. I get a path not found error on this line.
Open strFile For Binary Access Write As #lngFile
however if I leave TheDBGUYs code the way it was I and just take out the cleanup I still get a gif file that says it can't be opened.