how can I create login form that it opens on main form and if login successfully it closes and shows main form and if login unsuccessfully alert. thanks
how can I create login form that it opens on main form and if login successfully it closes and shows main form and if login unsuccessfully alert. thanks
Login form is a common topic. Search forum or google. Here is one to start https://www.accessforums.net/program...ord-32218.html
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Here is one you can modify. Denis Wright was so kind to share it with me.
I might not be any hlep to you, but if you are good at figuring things out this may help. Good luck.
I forgot to include his instructions for the database above:
You will need to do the following:
- Unzip the Password items database
- Open a database that you want to use the password system on, and import everything from Password items (tblAssociate, frmPassword, Gearbox, and the 2 code modules)
- Edit tblAssociate to enter your user name and other details.
- Launch frmPassword, enter your name and password and hit OK. The Switchboard should launch.
That shows how to get to the Switchboard via a login. Now, for EVERY form where you want the read-write-edit permissions to be varied, you need to copy the code that is in the Form_Open event of Gearbox and paste that into the code module for each form. That code is
Private Sub Form_Open(Cancel As Integer)
Select Case gintLevel
Case 1 'read-only
Me.AllowEdits = False
Me.AllowAdditions = False
Me.AllowDeletions = False
Case 2 'edit existing records
Me.AllowEdits = True
Me.AllowAdditions = False
Me.AllowDeletions = False
Case 3 'create, add new, delete
Me.AllowEdits = True
Me.AllowAdditions = True
Me.AllowDeletions = True
End Select
End Sub
If you haven’t done this before, here are the steps:
- Open the form in Design view
- In the Properties go to Events, and find the On Open event.
- Double-click the blank line so you see [Event procedure], then click the … at the end of the line. You should then see
Private Sub Form_Open(Cancel As Integer)
End Sub
Replace that with the code above, close and save the form
Now when that form is opened from the switchboard the users should have the editing privileges defined by their level (see comments in the code).
There is one here on the forum FYI. I uploaded it myself a while back.
find:
Code:https://www.accessforums.net/access/open-form-another-form-32673.html#post166114