smtazulislam
Member
- Local time
- Today, 17:49
- Joined
- Mar 27, 2020
- Messages
- 806
I have 1675 records in my table of tblEMPLOYEEs. Every single items like Image, Passport, Contract etc. is separated folder and In the folder have two kinds of file type is like Image, pdf.
I need a function call in my every(Where needed) textbox in Datasource filed like
'For Employee Image (.jpg)
'For Employee Passport (pdf)
Then a button to open this Image or Pdf
Advanced thanks any help.
I need a function call in my every(Where needed) textbox in Datasource filed like
'For Employee Image (.jpg)
Code:
=fncIsLoadLoc("Image", EmployeeID) ' Folder Name and Employee ID numbers
'For Employee Passport (pdf)
Code:
=fncIsLoadLoc(Passport, EmployeeID) ' Folder Name and Employee ID numbers
Code:
Public Function fncIsLoadLoc(sFolderName As Control, sEmployeeID As String)
Dim rst As DAO.Recordset
Dim strFullPath As String
Set rst = CurrentDb.OpenRecordset("tblFolderPathSyncing")
'I dont know how to call below twice variable. Help me here.
sFolderName = rst2!Locations & "\" & rst2!SubFolderName & "\"
sEmployeeID =
strFullPath = sFolderName & "\" & sEmployeeID
' Result
fncIsLoadLoc = strfullPath
rst.Close
End Function
Then a button to open this Image or Pdf
Code:
Private Sub CmdViewImage_Click()
Dim strPath As String
'Setting path
strPath = Me.txtEmployeePicture & ""
If Dir(strPath) = "" Then
MsgBox "Your Image folder is not available same numbers of employee picture !" & vbCrLf & "Check and try again !", vbExclamation, "Open Picture"
Exit Sub
End If
' Oppening file
Application.FollowHyperlink strPath
End Sub