Selasa, 27 November 2012

Re: [MS_AccessPros] Tracking user profile

 

John,

So are public variables then kept (assuming the front end) and accessible as long as the user is logged in? So that if I have a bunch of boolean variables (e.g. OrderApprove), I can the use code like
If OrderApprove = True then
code to hide, lock, enable different fields
End If

A One issue with the approach of writing separate "wrapper" functions is that the different types of permissions do change. I maintain the list of permissions in a table tblPermissions. Is there a way to generate these variables from the list in that table?

Adam

--- In MS_Access_Professionals@yahoogroups.com, John Viescas <JohnV@...> wrote:
>
> Adam-
>
> I prefer to use a table in combination with Public variables to do this.
> It's a known fact that stuff stored in memory can "disappear" of there's
> an error. And a "hidden" form may not always be hidden and is slower to
> reference.
>
> Here's what I do in a Standard module:
>
> Option Compare Database
> Option Explicit
>
> Dim pstrLoginName As String
>
> Public Function GetUser() As String
>
> If Len(pstrLoginName) = 0 Then
> pstrLoginName = DLookup("UserName", "ztblUserData")
> End If
>
> GetUser = pstrLoginName
>
> End Function
>
> Of course, this assume you stored the user name at login in ztblUserData.
>
> You can write as many "wrapper" functions as you like to grab / populate
> the module variables.
>
> John Viescas, Author
> Microsoft Access 2010 Inside Out
> Microsoft Access 2007 Inside Out
> Microsoft Access 2003 Inside Out
> Building Microsoft Access Applications
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
>
>
> -----Original Message-----
> From: AdamF <runuphillracing@...>
> Reply-To: <MS_Access_Professionals@yahoogroups.com>
> Date: Tuesday, November 27, 2012 9:56 PM
> To: <MS_Access_Professionals@yahoogroups.com>
> Subject: [MS_AccessPros] Tracking user profile
>
> Currently, when a user logs in, I open an unbound, hidden form, and write
> their profile info (from a table using their login name) to that form
> (frmUser). I then refer to that form on numerous pages to customize the
> view and edit/delete/add authorities. I did this because it seems a lot
> quicker to look up in a form than using dlookup to tblUserProfile.
>
> Is there a better way?
>
> I've thought about creating a set of two local (front end) tables with
> this info, in lieu of an unbound form.
>
> I think I recall somewhere about tracking properties in VB. I have no idea
> how that works.
>
> Adam
> Denver, CO
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar