New Feature trying to add.
Users Picture (path) is stored in tblEmployees.
tblEmployees
EmployeeID
ProfilePicture (Text)
ProfilePath (text)
frmEmployees
Image named ProfilePictureImage that shows their picture.
All is well.
I need to display their picture on the Main form named frmMain
I have a field txtuserid which captures the user name from frmLogin
I also have a image on frmMain named ProfilePictureImage that I want to display their picture.
Any Help Appreciated
Who is Logged In Picture on Form
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Who is Logged In Picture on Form
In the On Load event of frmMain:
If the ProfilePath field ends in \, you should omit & "\" from the above code.
Code: Select all
Private Sub Form_Load()
Me.ProfilePictureImage.Picture = DLookup("ProfilePath", "tblEmployees", "EmployeeID='" & Me.txtuserid & "'") & "\" & _
DLookup("ProfilePicture", "tblEmployees", "EmployeeID='" & Me.txtuserid & "'")
End Sub
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 550
- Joined: 30 Jul 2014, 23:58
Re: Who is Logged In Picture on Form
Data type mismatch since EmployeeID is numeric and txtuserid is text
Now I need to capture the EmployeeID somehow I guess for the user logging in???
Now I need to capture the EmployeeID somehow I guess for the user logging in???
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Who is Logged In Picture on Form
Indeed, store EmployeeID in txtuserid , and change the code to
Code: Select all
Private Sub Form_Load()
Me.ProfilePictureImage.Picture = DLookup("ProfilePath", "tblEmployees", "EmployeeID=" & Me.txtuserid) & "\" & _
DLookup("ProfilePicture", "tblEmployees", "EmployeeID=" & Me.txtuserid)
End Sub
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 550
- Joined: 30 Jul 2014, 23:58
Re: Who is Logged In Picture on Form
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Who is Logged In Picture on Form
I edited my previous reply immediately after posting it. It's better to view the post in the forum than in the email notification, in case the poster edits it, as here.
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 550
- Joined: 30 Jul 2014, 23:58
Re: Who is Logged In Picture on Form
Thanks. I could not get it to work.
Will keep on trying. I have scaled down to demo it.
Will keep on trying. I have scaled down to demo it.
You do not have the required permissions to view the files attached to this post.