J
Jon
Hi,
I have a form for registering new employee. In this form there is a button
for adding the path of the pic of the employee
I put the below code in the event of on click
But when I run the form that shows me there is a wrong in the line as follows
strFilter = ahtaddfilteritem(strFilter, "Images Files",
"*.gif;*.jpeg;*.jpg;*.bmp;*.tif")
StartDir = "c:\"
Can any body tell me what is wrong with it:
Private Sub cmdUpload_Click()
On Error GoTo cmdUpload_Click_Error
Dim strFilter As String
Dim lngFlags As Long
Dim Docpath, FileName, StartDir, driveletter As String
strFilter = ahtaddfilteritem(strFilter, "Images Files",
"*.gif;*.jpeg;*.jpg;*.bmp;*.tif")
StartDir = "c:\"
Docpath = ahtCommonFileOpenSave(InitialDir:=StartDir,
Filter:=strFilter, FilterIndex:=3, flags:=lngFlags, DialogTitle:="Select
Document")
If Not Docpath = "" Then
FileName = Dir(Docpath)
'Me.imgPath = FileName & "#" & Docpath & "#"
Me.ImagePath = Docpath
End If
On Error GoTo 0
Exit Sub
cmdUpload_Click_Error:
MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf &
"Error Number: " & _
Err.Number & vbCrLf & "Error Source: Form_Images frm / imgPath_DblClick"
& vbCrLf & _
"Error Description: " & Err.Description, vbCritical, "An Error has
Occured!"
Resume Next
End Sub
I have a form for registering new employee. In this form there is a button
for adding the path of the pic of the employee
I put the below code in the event of on click
But when I run the form that shows me there is a wrong in the line as follows
strFilter = ahtaddfilteritem(strFilter, "Images Files",
"*.gif;*.jpeg;*.jpg;*.bmp;*.tif")
StartDir = "c:\"
Can any body tell me what is wrong with it:
Private Sub cmdUpload_Click()
On Error GoTo cmdUpload_Click_Error
Dim strFilter As String
Dim lngFlags As Long
Dim Docpath, FileName, StartDir, driveletter As String
strFilter = ahtaddfilteritem(strFilter, "Images Files",
"*.gif;*.jpeg;*.jpg;*.bmp;*.tif")
StartDir = "c:\"
Docpath = ahtCommonFileOpenSave(InitialDir:=StartDir,
Filter:=strFilter, FilterIndex:=3, flags:=lngFlags, DialogTitle:="Select
Document")
If Not Docpath = "" Then
FileName = Dir(Docpath)
'Me.imgPath = FileName & "#" & Docpath & "#"
Me.ImagePath = Docpath
End If
On Error GoTo 0
Exit Sub
cmdUpload_Click_Error:
MsgBox "MS Access has generated the following error" & vbCrLf & vbCrLf &
"Error Number: " & _
Err.Number & vbCrLf & "Error Source: Form_Images frm / imgPath_DblClick"
& vbCrLf & _
"Error Description: " & Err.Description, vbCritical, "An Error has
Occured!"
Resume Next
End Sub