Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Unlock controls based on user type when form opens

Posted on 2011-09-09
6
Medium Priority
?
223 Views
Last Modified: 2012-06-21
I have an Access 2003 form that records updates and also allows entry of time, but time entry is only availabe is the person's work type is 'DEV'.  I have a procedure that checks the perons's type and if it is DEV, then when the form Opens, I want the time controls unlocked.  but it seesm I have a problem in that the code does not run (i get null values) so I think it is a resolutionissue as to which event should I put the procedure to run to unlock when teh form opens?
0
Comment
Question by:ssmith94015
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36511433
<I want the time controls unlocked.>

what time controls are talking about ?

are these textboxes from the form ?

<I have a procedure that checks the perons's type and if it is DEV>
how do you apply the result to you unlocked the time controls ?
0
 

Author Comment

by:ssmith94015
ID: 36511495
The time control are where the developers enter the project they are working on and the amount of time they spent on it.  I would ideally like these text boxes available for data entry when the form opens, checks the user id and determines that it is a develoer, otherwise, these fields should remain disabled.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 36511658

are you assigning the result of  "procedure that checks the perons's type and if it is DEV" to a global variable ?

lets assume you assigned the value to a global string  gVariableDev

in the open or load event of the form

me.textTimer.enabled= (gVariableDev="DEV")
0
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

Author Comment

by:ssmith94015
ID: 36511736
Should this be a function that returns a value to a global variable?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36511787
post the Procedure that you are talking about ..

where is this pocedure, in a regular module ?
0
 

Author Closing Comment

by:ssmith94015
ID: 36511803
Actually, this gave me an idea that satisifed what I needed.  I assigned the global value on the calling form, which set the value I needed on the called form and it is happy little form now.  Does exactly what I want.

Sandra
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question