Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Wed, 6 Aug 2008 15:50:00 -0700,    group: microsoft.public.access.macros        back       


SetProperty   
I have a checkbox field named Highlight.  When I open the form, I would like 
this field to be disabled unless CurrentUser = "Admin".  Is that possible?  
And should i be using a macro or some other method?
date: Wed, 6 Aug 2008 15:50:00 -0700   author:   Harvard

Re: SetProperty   
In The OnCurrent event of the form put this:

If CurrentUser="Admin" Then
   Me.WhateverControl.Visible = True
Else
   Me.WhateverControl.Visible = False
EndIf

Bonnie
http://www.dataplus-svc.com

Harvard wrote:
>I have a checkbox field named Highlight.  When I open the form, I would like 
>this field to be disabled unless CurrentUser = "Admin".  Is that possible?  
>And should i be using a macro or some other method?

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-macros/200808/1
date: Thu, 07 Aug 2008 11:20:00 GMT   author:   bhicks11 via AccessMonster.com u44327@uwe

Re: SetProperty   
Harvard,

Bonnie has given a VBA solution.  A simplified version of her code is:
    Me.Highlight.Enabled = CurrentUser = "Admin"

But yes, you can also do this with a macro.  Either using a SetValue 
action, or SetProperty as you suggested.  This would be on the Current 
event of the form.  Set the arguments of the SetProperty action like this:
   Control Name: Highlight
   Property: Enabled
   Value: =([CurrentUser]="Admin")

-- 
Steve Schapel, Microsoft Access MVP

Harvard wrote:
> I have a checkbox field named Highlight.  When I open the form, I would like 
> this field to be disabled unless CurrentUser = "Admin".  Is that possible?  
> And should i be using a macro or some other method?
date: Fri, 08 Aug 2008 08:15:05 +1200   author:   Steve Schapel

Re: SetProperty   
Harvard,

Just thinking, since the CurrentUser will not change within a given 
session of the database, you could also put this code on the form's Open 
or Load event, in fact this would probably be preferable to the Current 
event.

-- 
Steve Schapel, Microsoft Access MVP

Steve Schapel wrote:
> Harvard,
> 
> Bonnie has given a VBA solution.  A simplified version of her code is:
>    Me.Highlight.Enabled = CurrentUser = "Admin"
> 
> But yes, you can also do this with a macro.  Either using a SetValue 
> action, or SetProperty as you suggested.  This would be on the Current 
> event of the form.  Set the arguments of the SetProperty action like this:
>   Control Name: Highlight
>   Property: Enabled
>   Value: =([CurrentUser]="Admin")
>
date: Fri, 08 Aug 2008 08:51:32 +1200   author:   Steve Schapel

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us