Got a little problem in "add image" button

ubeyou

New member
Local time
Today, 05:35
Joined
Aug 17, 2008
Messages
8
Private Sub cmdAddImage_Click()
On Error GoTo cmdAddImage_Err
Dim strFilter As String
Dim lngflags As Long
Dim varFileName As Variant

strFilter = "All Files (*.*)" & vbNullChar & "*.*" _
& vbNullChar & "All Files (*.*)" & vbNullChar & "*.*"

lngflags = tscFNPathMustExist Or tscFNFileMustExist _
Or tscFNHideReadOnly

varFileName = tsGetFileFromUser( _
fOpenFile:=True, _
strFilter:=strFilter, _
rlngflags:=lngflags, _
strDialogTitle:="Please choose a file...")

If IsNull(varFileName) Then
Else
Me![Text28] = varFileName
Forms![customer].Form.Requery
End If

cmdAddImage_End:
On Error GoTo 0
Exit Sub

cmdAddImage_Err:
Beep
MsgBox Err.Description, , "Error: " & Err.Number _
& " in file"
Resume cmdAddImage_End
End Sub
When i click addimage, it will auto generate an error said" Compile error, sub and function not defined."

How to resolve tihs problem?
 
Have you included the tsGetFileFromUser function in your standard modules?
 
ok i finally solve it, but i have another problem with this, when i add a image to 2nd record and the image is saved,, it will jump back to 1st record. when i add a image to 3rd record and the image is saved, it will also jump back to 1st record. There is no problem with the image, probably is the code.
Private Sub Photo_AfterUpdate()
setImagePath
Forms![Customer].Form.Requery
End Sub

Is it possible to stay in the record?
 
thanks buddy, Now i have another problem, I have an image button, how can i change the mouse cursor when i rollover it and make the image size bigger a bit? Thanks for the guidance.
 
thanks buddy, Now i have another problem, I have an image button, how can i change the mouse cursor when i rollover it and make the image size bigger a bit? Thanks for the guidance.
Sorry but I can't help you in those departments. Maybe someone else will drop by or you can start another thread.
 

Users who are viewing this thread

Back
Top Bottom