D
Dan @BCBS
I need to save an attachment in a field.
I can code a button to open the Windows "GetOpenFileName" dialog window then
the user finds the file. But I cannot save that file.... I get an error 438:
Object doesn't support this property or method in Form_Open..
In the code below, the Me![doc].Picture is where I am trying to save it..
I posted this eailier but forgot what the subject was:
Private Sub CommFind_Click()
On Error GoTo ErrHandler
Dim lngFlags As Long
Dim strFilter As String
strFilter = ahtAddFilterItem(strFilter, "Compressed Image Files (*.jpg,
*.jff, *.gif, *.tiff )", _
"*.JPG;*.JFF,*.GIF,*.TIF")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strPathAndFile = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Choose the Compressed Image File")
If Len(strPathAndFile) > 0 Then
Me![doc].Picture = strPathAndFile
Else
MsgBox "You didn't select a file", vbExclamation, "Images not copied"
Cancel = True
End If
Exit_Sub:
Exit Sub
ErrHandler:
MsgBox "Error " & Err.Number & " : " & Err.Description & " in
Form_Open", vbExclamation, "Images in Access Example"
Cancel = True
Resume Exit_Sub
End Sub
I can code a button to open the Windows "GetOpenFileName" dialog window then
the user finds the file. But I cannot save that file.... I get an error 438:
Object doesn't support this property or method in Form_Open..
In the code below, the Me![doc].Picture is where I am trying to save it..
I posted this eailier but forgot what the subject was:
Private Sub CommFind_Click()
On Error GoTo ErrHandler
Dim lngFlags As Long
Dim strFilter As String
strFilter = ahtAddFilterItem(strFilter, "Compressed Image Files (*.jpg,
*.jff, *.gif, *.tiff )", _
"*.JPG;*.JFF,*.GIF,*.TIF")
strFilter = ahtAddFilterItem(strFilter, "All Files (*.*)", "*.*")
strPathAndFile = ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Choose the Compressed Image File")
If Len(strPathAndFile) > 0 Then
Me![doc].Picture = strPathAndFile
Else
MsgBox "You didn't select a file", vbExclamation, "Images not copied"
Cancel = True
End If
Exit_Sub:
Exit Sub
ErrHandler:
MsgBox "Error " & Err.Number & " : " & Err.Description & " in
Form_Open", vbExclamation, "Images in Access Example"
Cancel = True
Resume Exit_Sub
End Sub