UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
3 Pages V  1 2 3 >  (Go to first unread post)
   Reply to this topicStart new topic
> Logon form with Custom Security    
 
   
dallr
post Dec 26 2009, 04:35 PM
Post#1


UtterAccess VIP
Posts: 3,078
Joined: 4-November 04
From: The Land of the Access Ninja's


This is something for you guys to play with. Seeing that it is Christmas you can consider it a Christmas Gift. LOL
This is an easy way for you to incorporate custom security with your applications. All the necessary objects are already created and it is just for you to import it into your application.
You will get a logon form and depending on which group the user belongs to who is logging in certain controls on forms will be disabled. So basically you can disable controls on forms and subforms depending on the user who is logged in. You can also stop users from viewing any report depending on their level of access. The report will close as they open it.
I have created a detailed tutorial also attached it.
To test use the following Username and passwords
Group:..............................username:............ Password
Junior Administrator:............ DM................... 1234
Power User:.......................JB.................... 1234
Entry Level:.......................MJ.................... 1234
All feedback is welcomed
[/code]
Dane
Attached File(s)
Attached File  Advanced Custom Security.zip ( 455.59K )Number of downloads: 681
 
Go to the top of the page
 
dallr
post Dec 27 2009, 09:29 PM
Post#2


UtterAccess VIP
Posts: 3,078
Joined: 4-November 04
From: The Land of the Access Ninja's


I realized that the web links on the pdf attachment I first posted are not working. I am reattaching the tutorial in a Micosft word format so that users can go to the webpages in the tutorial.
ane
Attached File(s)
Attached File  Advanced Custom Security.zip ( 376.21K )Number of downloads: 393
 
Go to the top of the page
 
noppojp
post Dec 29 2009, 09:06 AM
Post#3



Posts: 257
Joined: 21-October 05
From: Tokyo, Japan


Dane,
Thank you for this. I have used your previous version of this ULS solution for 1 year It made a lot of people happy, and has worked perfectly. The ability to isolate, by loginID, who sees what form/button/report, etc has proved to a major plus for my DB. I'll be using this simplified version shortly! Thanks mate!
notworthy.gif
Cheers from Tokyo
Go to the top of the page
 
Belimisimus
post Jan 2 2010, 12:55 PM
Post#4



Posts: 32
Joined: 8-December 09
From: Croatia


First thank for this.
Second, I have a problem! sad.gif
On 4th step of the Implementation when I need to open the form “frm_Administrator” error box is display with next note: "Compile error: Variable not defined" and it highlight me "adOpenStatic" in Custom security code
' Now focus on disabling controls on the main form.
rst.Open SQL, cnn, adOpenStatic
Do you perhaps know how to get it work?
Go to the top of the page
 
dallr
post Jan 2 2010, 09:42 PM
Post#5


UtterAccess VIP
Posts: 3,078
Joined: 4-November 04
From: The Land of the Access Ninja's


The original version not this was created with early binding. Then I changed it to late binding so users do not have to set a reference. See the below code and pay particular attention to the comments.
CODE
Dim cnn As Object 'Dim cnn As ADODB.Connection
Dim rst As Object 'Dim rst As ADODB.Recordset
et rst = CreateObject("ADODB.Recordset") 'Set rst = New ADODB.Recordset

So in light of the late binding you need to change the constant adOpenStatic and replace it with is associated value which is 3. Therefore this line is removed.
CODE
rst.Open SQL, cnn, adOpenStatic

And it is replaced with this.
CODE
rst.Open SQL, cnn, 3

I have also made the changes in the application and posted an updated version. Use the Custom Security Module from the attached version.
Dane
Attached File(s)
Attached File  Advanced Custom Security.zip ( 373.1K )Number of downloads: 364
 
Go to the top of the page
 
Belimisimus
post Jan 5 2010, 03:28 AM
Post#6



Posts: 32
Joined: 8-December 09
From: Croatia


Thanks, everything is working fine.
I'm beginner with access and this was(is) very helpful!
Go to the top of the page
 
dallr
post Jan 5 2010, 12:11 PM
Post#7


UtterAccess VIP
Posts: 3,078
Joined: 4-November 04
From: The Land of the Access Ninja's


I am glad that you found it to be useful.
I am uploading another version. In the previous version you can add a user to the users table and once a record is there they can log into the system. The new changes would not give the user access unless they are part of a group.
Therefore they must be a registered user as well as a member of a group.
See attached DB.
Dane
Attached File(s)
Attached File  Advanced Custom Security.zip ( 377.08K )Number of downloads: 751
 
Go to the top of the page
 
justin071894
post Jan 10 2010, 06:33 PM
Post#8



Posts: 34
Joined: 10-January 10
From: Columbus, Ohio


how would i go about adding this to my database?
Go to the top of the page
 
dallr
post Jan 10 2010, 06:42 PM
Post#9


UtterAccess VIP
Posts: 3,078
Joined: 4-November 04
From: The Land of the Access Ninja's


Just follow the word tutorial in the downloadable word file.
Go to the top of the page
 
kclark
post Jan 17 2010, 05:21 PM
Post#10



Posts: 233
Joined: 9-December 09
From: Metairie, LA


This is AWESOME! I needed this soooo much. Thank you. Question...Can we track all changes a user makes with this design?
Go to the top of the page
 
kclark
post Jan 17 2010, 06:50 PM
Post#11



Posts: 233
Joined: 9-December 09
From: Metairie, LA


Also, my logon form is not closing...
Go to the top of the page
 
kclark
post Jan 17 2010, 06:58 PM
Post#12



Posts: 233
Joined: 9-December 09
From: Metairie, LA


It is closing, nevermind. Forgot to put the code in the frm_Main Form. Sorry!
Go to the top of the page
 
dallr
post Jan 17 2010, 07:10 PM
Post#13


UtterAccess VIP
Posts: 3,078
Joined: 4-November 04
From: The Land of the Access Ninja's


Glad you like the code!!
ep you need to place the stipulated code on your mainform to close the logon form.
If you want some code to log user changes then you can look at the following which I have in the archives.
Track Changes
Dane
Go to the top of the page
 
kclark
post Jan 20 2010, 10:07 AM
Post#14



Posts: 233
Joined: 9-December 09
From: Metairie, LA


Wow! Would you put this code on subforms too? Unlike the custom security.
Go to the top of the page
 
dallr
post Jan 20 2010, 10:20 AM
Post#15


UtterAccess VIP
Posts: 3,078
Joined: 4-November 04
From: The Land of the Access Ninja's


I am not sure if I am understanding you question.
ane
Go to the top of the page
 
kclark
post Jan 20 2010, 11:43 AM
Post#16



Posts: 233
Joined: 9-December 09
From: Metairie, LA


Ok when i incorporate the code (Track Changes) on the main forms and logon. I get the mainform but when I select a button to open a specified form, I get an error The OpenForm action was canceled...
Go to the top of the page
 
kclark
post Jan 20 2010, 11:46 AM
Post#17



Posts: 233
Joined: 9-December 09
From: Metairie, LA


Well in your instructions for the custom security, you said to put the code on main forms only and not imbedded subforms...
But for the tracking code(audit) do you put the code in only the main forms or also in the imbedded subforms?
Go to the top of the page
 
kclark
post Jan 20 2010, 12:03 PM
Post#18



Posts: 233
Joined: 9-December 09
From: Metairie, LA


Ok you are going to laugh...well maybe not. The reason I was getting the error is because I have the back end and front end DBs. I had all the modules in the BE and not the FE! So SORRY! blush.gif
Go to the top of the page
 
kclark
post Jan 20 2010, 02:57 PM
Post#19



Posts: 233
Joined: 9-December 09
From: Metairie, LA


For example, to track the form controls, use .FormControl Me.[ControlName]
But if I wanted to track a control that is on a subform how would I write that? I have used the ones below in the main form code:
.FormControl Me.[subformName].Form.[ControlName]
.FormControl Forms.[MainFormName].[subformName].Form.[ControlName]
I have also tried putting the code in on the form of the subform as well..no luck.
Go to the top of the page
 
mtpwebb
post Jan 20 2010, 04:48 PM
Post#20



Posts: 3
Joined: 26-March 04



Dane - I also had a error at Step 3 Update New Controls. I open the frm_Administrator, click Update New Controls and receive compile error: Wrong number of arguments or invalid property assignment. It highlights .OpenReport from the line of code "DoCmd.OpenReport rptName, acViewDesign, , , acHidden"
also had this error when clicking Update New Controls in your sample database, and ideas? Thanks.
Go to the top of the page
 
3 Pages V  1 2 3 >


Custom Search
RSSSearch   Top   Lo-Fi    11th December 2017 - 07:59 PM