pr2-eugin
Super Moderator
- Local time
- Today, 23:26
- Joined
- Nov 30, 2011
- Messages
- 8,494
Things are okay.. Work's been stressing.. But alright, thanks.. Hope they are well with you too..Hi Paul, I am trusting that all is well;

Yes, you have to change the code from a simpleI have been doing well with my database but something else came up that I thought to seek your advice on.
1. Instead of the username appearing on the form after login success, I would like to use the actual name of the person that have entered the database. That means in my tblUser table, I already have username, password, user actual name, position, ect. Is it than possible to replace the lookup colom [username] with the actual name colom?
Code:
pubStrUserID = Me.txtLoginID
Code:
pubStrUserID = DLookUp("[COLOR=Blue][B]actualUserName[/B][/COLOR]", "tblUsers", "strUserID = '" & Me.txtLoginID & "'")
There are many ways to do this.. Creating a Logger table, Or just two other columns in the table, with user name and Date modified and then use the BeforeUpdate event of the Form, where you check if it the New Record (taking the assumption), and fill those information..2. I would also like to include in my tables if user X is entering data, a colom should show the username of user X against that data with entry date in another colom.
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.NewRecord Then
Me.[COLOR=Blue][B]theNewUserFieldName[/B][/COLOR] = pubStrUserID
Me.[COLOR=Blue][B]theNewDateFieldName[/B][/COLOR] = Date()
End If
End Sub