Filter by User Name

Djblois

Registered User.
Local time
Today, 07:01
Joined
Jan 26, 2009
Messages
598
I am trying to create this query for my logfile to filter by UserName and it will not work. Here is the query:

Code:
SELECT tblLog.ErrorNum, tblLog.ErrMessage, tblErrors.Description2007, tblLog.UserName, tblLog.ErrTime, tblLog.BuildNum, tblLog.CurrentSub, tblLog.CurrentControl, tblLog.Notes, tblLog.Server
FROM tblLog LEFT JOIN tblErrors ON tblLog.ErrorNum = tblErrors.ErrorID
WHERE (((tblLog.UserName)=[Forms]![frmLogFile]![cobUserName]))
ORDER BY tblLog.ErrTime;

I even put me.requery in the form that is attached to this code. What am I missing?
 
Thank you IBM freak - I did try it by itself and it works perfectly, by itself. Why doesn't it work in the form then? I will try to put a username in there first now.
 
When I put the name in the Query directly that works perfectly also. This is real confusing. lol
 
Hi Everyone,
I Need help in order to filter a query based on the user who is crrently logged. I have used a workgroup before but this time, I want to use the database I have found in this site for the log in log out. My problem is that I cannot use the [CurrentUser] criteria anymore (as I am not using a workgroup anymore) to filter my query and I am finding out a way on how I can filter the query based on the user who is currently logged in.

Any help is very much appreciated

I have attached a sample database.
 

Attachments

Users who are viewing this thread

Back
Top Bottom