Advertisement

05.19.2008 at 12:18PM PDT, ID: 23414887
[x]
Attachment Details

Filter based on CurrentUser

Asked by peggyweber in Access Forms, Databases Miscellaneous

Tags: Microsoft, Access, 2003

I would like to filter a list of returned values from a table listed in a form  based on CurrentUser() name appears in specific field on that form.

Note I can get the filter work if I type in a hard code like johndoe in place of where CurrentUser name is being used in the filter.   however if I ask it to use the CurrentUser() name it does not filler and pulls no record.  Even the message box that is setup returns the correct value for the CurrentUser but it just won't filter

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
Private Sub Form_Open(Cancel As Integer)
 
 
Dim usercheck As String
 
usercheck = CurrentUser()
 
Me.Filter = "TTM_TimeCardHours.EmployeeID = 'usercheck'"
Me.FilterOn = True
 
MsgBox CurrentUser() & ", Hi." & usercheck
 
 
End Sub
[+][-]05.19.2008 at 12:25PM PDT, ID: 21600749

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Forms, Databases Miscellaneous
Tags: Microsoft, Access, 2003
Sign Up Now!
Solution Provided By: stevbe
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.19.2008 at 01:26PM PDT, ID: 21601254

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 01:07PM PDT, ID: 21627112

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2008 at 01:10PM PDT, ID: 21627135

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628