472,958 Members | 2,562 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 1145
32,547 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
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
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)
  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
  8. End Sub
Apr 13 '16 #4
32,547 Expert Mod 16PB
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.

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

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...
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...
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...
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,...
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...
by: vstolmech513 | last post by:
Is there a way to add an input mask in an input box?
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 <%...
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...
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...
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...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

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.