Re: open a form with userlevel criteria
- From: "Mark Carlyle via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxx>
- Date: Tue, 09 Aug 2005 00:45:41 GMT
I got lucky and figured this out partially... I used this code...
Dim strCriteria As String
Dim repname As String
repname = CurrentUser()
replogin = DLookup("[rep number]", "Debt Advisors", "[username] ='" & repname
& "'")
strCriteria = "[salesperson] = '" & replogin & "'"
Me.Filter = strCriteria
Me.FilterOn = True
The final problem I am having with this is how can i keep it so the filter
cannot be removed? I do not want my reps to be able to just remove the
filter and then see everyone else's info.
TIA for any help.
Mark Carlyle wrote:
>I want to open my database directly to a form and filter that form to only
>show info pertaining to the user that is currently logged in.
>
>Now I have a User Database that assings a "rep number" to each person.
>
>My forms already sort the data by the "rep number"
>
>What I want to do is compare the CurrentUser() info to the Debt Advisor table
>and find the rep number that matches the current user.
>
>Then filter the current form "greybar" to only show data where the rep number
>of the currentuser = the repnumber of the form.
>
>I hope what I am writing is understandable... thanks in advance for any help.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200508/1
.
- Follow-Ups:
- Re: open a form with userlevel criteria
- From: John Nurick
- Re: open a form with userlevel criteria
- References:
- open a form with userlevel criteria
- From: Mark Carlyle via AccessMonster.com
- open a form with userlevel criteria
- Prev by Date: Re: Formatting Text in a Textbox
- Next by Date: Cannot Set recordset in A2003
- Previous by thread: open a form with userlevel criteria
- Next by thread: Re: open a form with userlevel criteria
- Index(es):
Relevant Pages
|