Re: Combo Box Filter according to user log in



"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


.



Relevant Pages

  • RE: hfs ishell owner field blank
    ... Your problem is due to you not having a userid in your security database ... assigned with that UID, but that user is no longer in the security ... hfs ishell owner field blank ...
    (bit.listserv.ibm-main)
  • RE: How to restrict users to see data in a mutiuser environment?
    ... interested setting up workgroup security. ... ' Gets the userid of the current user. ... Dim Length As Long ... which you open the form you want to filter. ...
    (microsoft.public.access.modulesdaovba)
  • Re: References for Brivo Systems Door Access Controls?
    ... I don't like the security ... happens when someone steals my userid and password? ... The panel is Internet connected and they connect to it ... you'd have to find some access control panels and some ...
    (alt.security.alarms)
  • RE: How to restrict users to see data in a mutiuser environment?
    ... ' Gets the userid of the current user. ... Dim Length As Long ... If you plan to use workgroup security, you could assign users to groups by ... which you open the form you want to filter. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Finding Records
    ... > login point forward that this user created. ... in the table to store the UserID, and the form whereby records are added ... security, rather than using Access's built-in user-level security (which ... UserID is an administrator. ...
    (microsoft.public.access.formscoding)