Re: Combo Box Filter according to user log in
- From: "Carl Rapson" <mr.mxyzptlk@xxxxxxxxxxxxxxxxx>
- Date: Fri, 10 Aug 2007 10:16:21 -0500
"fpcsql" <fpcsql@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:30EC949D-77B1-4C1A-A056-AB1C2B3DE26D@xxxxxxxxxxxxxxxx
Please help me with the following which is driving me insane:
In my application, users are required to log in - not using microsoft
security. Have table with userid, username, password and level of access
allowed per user. (security table)
These users will choose items from a combo box to print. The problem lies
in
restricting each user to print only his / her allowed items (at a record
level) from the detail table.
So this combo box lists the items found in the detail table on condition
that the userid = the user id on the security table for the user logged in
at
that time.
I have stored the userid as a public variable in a module, but am still
having problems in restricting the data list displayed in the combo box. I
think there is something wrong with my syntax.
Dim rst As Object
Dim uid As String
Set rst = Me.Recordset.Clone
uid = User.SecurityID
rst.FindFirst "[SchemeName] = '" & Me![scheme] & "'" & "[UserID] = '" &
uid & "'"
rst.Close
Another question is would it be a problem storing the userid as a public
variable, since it is a multi-user application?
I'd appreciate any help - Thanks
Your FindFirst syntax is wrong. It should be:
rst.FindFirst "[SchemeName] = '" & Me![scheme] & "' AND [UserID] = '" &
uid & "'"
As for your other question, it shouldn't be a problem because each user has
a separate copy of the application loaded into memory. However, for
integrity reasons, I would suggest splitting the application and placing a
copy of the "front-end" (forms etc) onto each user's PC and the "back-end"
(tables) on a server. Search the newsgroups for more information about
splitting and maintaining the front-end.
Carl Rapson
.
- Prev by Date: RE: Successful Tick Box
- Next by Date: Re: What is Automation ID?
- Previous by thread: Re: Cursor Postion after form Requery
- Next by thread: Re: How to code/perform a search
- Index(es):
Relevant Pages
|