I have read and read, but I cannot understand the simple DLOOKUP function. I think it will answer the need that I have right now, so I am going to ask that someone put it in laymans terms.
Here is an example of what I am looking for:
tblUsername
User LogOnName
------------------------------------
John Doe jdoe
Jane Smith jsmith
Joe Smith jsmith1
I have a downloaded module (thanks to that poster) that returns the person that is logged on to the machine (ie: jdoe, jsmith, jsmith1).
In the form's BEFORE UPDATE event I envision this:
strUserName as String
strUserName = UserName 'module function name that returns the currently logged on user
strUserName = 'convert strUserName to John Smith from jsmith somehow
cboUpdatedBy.setfocus
cboUpdatedBy.Text = strUsername
What I want to do is use that return to populate the "updated by" combo box with the User Name. I thought about hard coding the response in VB but even though they swear all of the users are accounted for you know that they are going to change next week. lol
Is the lookup function the way to go? I think so, but again I just can't seem to get it. Even if there is a better way can someone still explain it?
Thanks for you help, this is the best place anywhere for help!,
JerseyBoy
Here is an example of what I am looking for:
tblUsername
User LogOnName
------------------------------------
John Doe jdoe
Jane Smith jsmith
Joe Smith jsmith1
I have a downloaded module (thanks to that poster) that returns the person that is logged on to the machine (ie: jdoe, jsmith, jsmith1).
In the form's BEFORE UPDATE event I envision this:
strUserName as String
strUserName = UserName 'module function name that returns the currently logged on user
strUserName = 'convert strUserName to John Smith from jsmith somehow
cboUpdatedBy.setfocus
cboUpdatedBy.Text = strUsername
What I want to do is use that return to populate the "updated by" combo box with the User Name. I thought about hard coding the response in VB but even though they swear all of the users are accounted for you know that they are going to change next week. lol
Is the lookup function the way to go? I think so, but again I just can't seem to get it. Even if there is a better way can someone still explain it?
Thanks for you help, this is the best place anywhere for help!,
JerseyBoy