I have not seen that prompt to enter the ItemNumber.
Would you please upload a copy and I will have a look at the problem
Printable View
I have not seen that prompt to enter the ItemNumber.
Would you please upload a copy and I will have a look at the problem
Yam716
This prompt for ItemNumber is displayed because the field named ItemNumber could not be found in the relevant switchboard table.
If you changed the name of the fields in your switchboard tables then you will need to change the coding behind the switchboard forms or rename the field that was originally named ItemNumber back to the original name ItemNumber or you could also change the coding.
Allan,
I like it a lot, only problem is that when i tried the demo i only got level one menu regardless of who i loged in as, any idea why? it always gave me switchboard_lev1.
boanet
It was my mistake, when I made copies of the switchboard_lev1 for the other switchboards I did not change the record source and some minor coding on the new switchboards.
Attached is an updated version. Please contact me if require assistance etc.
17/11
Sorry, All I forgot to upload the zip file.
Allan, I like your demo file and am trying to incorporate it into something I am working on.
I created another table with some record info, the last two columns being an ModifiedDate and Modifiedby.
I then created a form to enter the records and set a before update event to record the time the record was modified, what I can't get is it to record the modified by, it asks me for the user id. Since I logged in when the db starts I thought I could pass the variable but it doesn't seem to be working. any ideas?
thanks
In the module mod_display_menu
Select Case valid_user
Case 2
' open and hide the utility form frm_utility
' this form will be used to store the user id for as required e.g recording the user id of an user adding records etc.
DoCmd.OpenForm "frm_utility", , , , , acHidden
This code opens a form frm_utility and hides it. When the menu screen opens the Login screen closes.
To store the user id you need to do the following
me!user_id =forms!frm_utility!user_id
change me!user_id to your variable name etc.
Message #44 has the latest version with the frm_utility
ok, so I'm a dufus, I saw the lines you were talking about (after I downloaded v3) I looked at the utility and it shows the user I logged in as. I tried the modified line in my event proceedure but it wouldn't let me save the record or anything. I had to take the line back out.
(i zipped it but it's like 108k so it wouldnt attach)
i played around with it and still haven't firgured out where I need to put the line to fix it.
i put compressed it with rar, then put it in a zip so I could attach it
thanks again!
In your code for form Table2 you can not have Me!user_id = Forms!frm_utility!user_id outside the Sub and End Sub
Change the code in your form Table2 to read as below.
Option Compare Database
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me![ModifiedDate].Value = Now()
Me![ModifiedBy].Value = Forms!frm_utility!user_id
End Sub
yeah I tried that first, I kept getting error:
The expression Before Update you entered as the event property setting produced the following error: Invalid Outside proceedure
I figured I did something wrong and tried different ways in different places.
By having the code outside the SUB you will get that error message.
I have attached an updated version with the correct code. The User Name and Password is FRED. I have placed a menu item to open the form Table2. Try it and let me know if there are any problems.
i don't see an attachment, did you update the one in post 44?
Sorry, I did not realise that the attachement was over the limit before I sent it.
Please send your email address to my email address below and I will send you the zip file. Alternatively I will add the form Table2 as a zip file to this thread.
email sent
Allan,
I am still playing with this. I was trying to test the login after I have made some other forms and changed the switchboard to those forms. Now I get the login prompt, when I login the switchboard flashes and then goes away. I also tried the password change form, I can change the password but the exit doesnt work it will never exit the form.
I can't see anything wrong, I didn't change any of that code.
thanks
Please post a zip copy of your database and I will look at it.
too big, will email it.
Hi Allan,
I'm a student, and I am attempting a project in Microsoft Access 2000. I have to create a user login form. I must use the username and passwords from a table and accordingly either allow access to the main menu or deny access. However, I am supposed to do this using macros. How can i do this?
I have a few more problems i encountered while doing this project, such as displaying an error message when the incorrect info is typed in, or clearing the text box after it is used.
i am very new at this, i hope you can help me! sorry for all the trouble and thank you very much!
Sarah
Read the messages and at message 45 is a demo version. Please contact me if you require more information.
Please read through this thread as I have placed examples in various messages.If you still require more information please post to this thread
thanks a lot
Hi allan,
Very nice login function you have posted. I have some questions. First, when you are logged in, and you want to have a list on the main menu, showing who is logged in, how can I make this? And second, I have made my own login function, but it is only one of the passwords which are working. Why? Is it my programming or something?
Rg. Brian
Hello Brian
Thank you for your comments.
To see who is logged in try this site: http://support.microsoft.com/kb/198755
What error message is displayed? Post your database to the forum, remove any confidental data before posting, just use sample data.
Thank you, I hope it suits your needs.
Let me know if require any more information
tiffany earrings
tiffany pendants
cheap tiffany rings
hello there! i need help about above topic How to create user login form (MS Access 2000 - 2003)
please help me
my email add is [email protected]
thanks in advance.
Hi Allan,
Thanks for all the demos you've provided. I'm fairly new to Access and your demos have been a great start in helping me remember my VB and learn Access' tools.
I have a quick question, in of the files you uploaded (login_demo_3.mdb) you were able to make 3 levels of security. I don't see how this is secure as when I log in with Level 1 access, I can still just go to the side panel, click on tbl_users and edit the users.
Is there anyway of making a database so that level 1 can only add information to given tables and create reports of them, but cannot edit in anyway, while level 2 has unrestricted access?
Your quick reply is greatly appreciated.
Thanks,
Josh
Josh
This databse was to show members how to mutliple access levels without using the security levels that comes with access.
You do not give the user access to a table so that they can add, edit or delete a record. You must use a form as an interface.
If you look at switchboard_lev1 in the ItemText field there is a menu item Add new User - Continuous Form in the command field there is a 2. When the user selects this menu item the code in the Private Function HandleButtonClick(intBtn As Integer) opens the form that is in the argument field for that menu item in the ADD mode only.
The next record in the table has a 3 in the argument field this allows the user to Edit a record.
To prevent the user seeingg "behind the scenes you will need to set your Startup options. What version of access are you using?
Reply to me off list and I will try and assist you.
This is the best login screen that I have yet to demo.
Thanks Alan
If I have time over the next couple of weeks I will post a variation to my previous examples. This new one does not access levels where there is a different switchboard for each level but one where the menu items are populated depending on the user's role.
I just want to say Allan Murphy is a GOD. I was looking for something on Google, ended up here, already knew how to do this but after reading the posts realized he has carried this topic for FOR DAMN YEARS! That deserves a medal, dude. Cheers to you, mate, and the few with your patience and perseverence.
And YES, I did register on this board for the sole purpose of making this post. You rarely see generosity like this, so when you do you have to give props.
Hey Allan, really appreciate your working sample on this ms access program. was searching for some reference to do my latest project and found your site on google. Am bookmarking this topic and followups. Please share further on any samples and it will be greatly appreciated.
Thank you!
Hi Allan,
Your Demo is fantastic, how do i change the button headings as it keeps defaulting back to the original.
thanks,
Stewart
Hello Stewart
The attached document explains the switchboard table. You ItemText to chnage the menu item.
Also read my reply on 06-08-2011 03:44 PM message 69 from memory that explains what the action means.
Please contact me if require further assistance.
Hi Allan,
I don't know if it0s ok to ask you this here but since its the same topic
I'd like to know how can I implement a login form in access 2010 for a web database meaning that I can't use VBA and it only has to implemented with macros.
Right now I have a table called users and I can verify if the user existsin the table to open the main form BUT I have the problem where the user just can close the window of the login form and they will be taken to the main form :(
How do you get to block this only with macros? I think there's not an onUnload event handler :(
Thanks!
Sorry, I do not experience with web databases.
Just a thought, on your Login form you could set the following properties Close Button from Yes to No. The Min Max buttons from Both Enabled to None. I know in an ordinary database this prevents the user from Closing the form or Minimising or maximizing the form.
If this fails may I suggest you post your request to the forum.
Thanks Allan for your reply.
Well, unfortunately it seems that on web databases the forms don't have all the functionality available :(
Close button and min max buttons properties are not present so I'm not able to control that way.
I'll just have to think a way to disable everything in the main form if some temp var has not been initialized. This way the user could close the login window but will end up with a main form completely disabled.
Niso
I you have a look at message 43 or 44 on this forum you will see examples of my login screen etc. The validation code maybe on the login screen or a module called Display menu.