473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Simple login form w/ different permissions?

70 64KB
I'm trying to create a very simple login form. I need it to have a text box where a user can enter a password and login to the db. At which point, they'd have full access to read data, edit data, add new records, or delete old records.

Or, if a user does not know the password, they can press a button to login w/ read only rights (and thus not be able to edit any data).

I realize this isn't extremely secure but we need it mostly to make it harder for people to do something they shouldn't be doing. For this small database, a simple login form will do.

I can create the form easily. What I'm confused about his how exactly to enable or disable write access. Currently, I have one main form which displays records in single form view. Then I have a subform (which isn't linked to main form) which will display records in datasheet view. Then a user can edit records in the single form and hit save. Or, they can add new records and hit save. If a user doesn't have the password, I need the text boxes and combo boxes to be locked and the save button should also be locked.
Apr 12 '16 #1
4 1155
NeoPa
32,556 Expert Mod 16PB
In such a case your whole database, and I guess I'm really talking about all the forms that handle showing and updating of data, needs to be designed to reference where you store the value indicating whether the user signed in or not and handle disabling of this property for each such form.

The important properties are :
AllowEdits; AllowAdditions & AllowDeletions.

Be careful with the simpler RecordsetType as setting it to Snapshot will have an extra effect of disabling the showing of updates from other sources too.
Apr 12 '16 #2
ittechguy
70 64KB
Thanks for the fast reply NeoPa!

Thus far, I have built a simple login form which contains a text box for the user to enter a password, a text box which contains the password (and is hidden), and two buttons.

There's a Login button which makes sure that the entered password matches what's stored in the text box. If they match, it opens a form.

Then I have a button which opens the same form like this:

DoCmd.OpenForm "Ciber_ITT_ResponseForm", DataMode:=acFormReadOnly

That opens the form in read only mode and the user is not allowed to make any edits. Not sure exactly what acFormReadOnly does. I assume it sets AllowsEdits to false.

Right now I need to figure out how to hide a couple buttons if the form is opened in read only mode.
Apr 13 '16 #3
PhilOfWalton
1,430 Expert 1GB
This is slightly long winded just depends exactly on what you mean by readonly.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Open(Cancel As Integer)
  2.  
  3.     If Me.AllowEdits = False And Me.AllowAdditions = False And Me.AllowDeletions = False Then
  4.         Btn1.Visible = False
  5.         Btn2.Visible = False
  6.     End If
  7.  
  8. End Sub
  9.  
Phil
Apr 13 '16 #4
NeoPa
32,556 Expert Mod 16PB
ITTechGuy:
Not sure exactly what acFormReadOnly does.
Well, here's a link that explains it pretty well (OpenForm Method). You'll have to click on the "AcFormOpenDataMode" link.

ITTechGuy:
Right now I need to figure out how to hide a couple buttons if the form is opened in read only mode.
As you guessed, and confirmed by reading the link, one of the settings it resets to false is AllowEdits. Thus, when the form opens (Form_Load() or Form_Open()), check that setting to determine if the form was opened that way or not.
Apr 13 '16 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: calaha | last post by:
Hi all, I have been working with this since last night, and can't quite figure out why it's not working. I have a simple login box form that is set to be my startup form in my Access app (upon...
1
by: nabil m | last post by:
hi i am using vs.net with csharp - i am trying to create a simple log in form user id password on submit i run a param query to check if the userid and password exist if yes i would like to...
5
by: Ronald S. Cook | last post by:
It's been longer that I remember since writing windows (not web) apps. 1) I want to load a main form 2) User clicks login button which brings up login form (on top of main form) 3) Upon...
2
by: Sasquatch | last post by:
I'm having trouble creating a simple login page using the asp:login control. I followed some instructions in a WROX book, "Beginning ASP.NET 2.0," and the instructions are very straight forward,...
5
by: olaamussah | last post by:
Hi, i just started learning perl which i would use for my uni. project unfortunately. Well, this is a simple user login page i tried to create but i cant get it to work. Can someone please check this...
7
by: vstolmech513 | last post by:
Is there a way to add an input mask in an input box?
14
by: j0rdanf1 | last post by:
Hi I have been asked to create a simple login form for a website and due to the lack of knowledge im struggling, so far I have a form which posts the information to the check.asp section <%...
1
by: carl2k2 | last post by:
Ok First I have a very simple way of entering data into a form and saving that into a text file, I made two text files for username(text1) and password(text2), I would like to make a simple login...
8
by: Harris Kosmidhs | last post by:
Hello, while I'm developing sites for some time I never coded a login form with security in mind. I was wondering what guidelines there are. For my point of view I'm thinking of using md5...
3
matheussousuke
by: matheussousuke | last post by:
I dont get any error message, it's simple, some pages works ok, they simply show "Welcome, 'username'. LOGOUT (link)" The same as Bytes, when u login, u dont see the form anymore, u just see a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.