473,396 Members | 1,961 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,396 software developers and data experts.

Can anyone help me with vba code that can compare two fields from two different table

I am developing a database to check staff attendance. I have two unbound forms, one as a,login form, and the other as a navigation form. I have four tables. They are tbl_Security1, tbl_Security2, tbl_User1, and tbl_User2.
Tbl_Security1 contains security_ID1 (number), and securityLevel_1 (number) (Admin, and User) as security levels.
Tbl_Security2 contains the ff: Security_ID2 (autonumber), and Security_Level2 (short text), (developer).
Tbl_User1 contains the ff: User_ID, User_Name, Password, and then User_Security (linked to SecurityLevel_1 in tbl_Security1).
Tbl_User2 also contains the ff: User_ID2 (autonumber), User_Name2 (short text), Password2 (short text), and User_Security2 (number), (Developer) (linked to Security_Level2 in tbl_Security2.
Now I need a vba code that will look into both tbl_User1 and tbl_User2 to check the fields Password and Password2 respectively so that if the txtpassword on the login form is same as any of them in the tables then permission is granted. The same applies to the name fields in both tables.
Also I want the code to restrict users from accessing Admin and Developer pages on the navigation form. I also want the Admin to have access to only Admin and User pages but not Developer page. I also want Developer to full access to all pages.
Thank you all
Jun 7 '15 #1
3 1453
zmbd
5,501 Expert Mod 4TB
You have two questions here we normally ask for the to be only one per thread :)

The following will cover both of your questions:

Insights: How To Create User Permissions and Customized Menus in MS Access

You might also consider the following:
>Thread>Ms Access DB Users>Post#6 especially the part about encrypting passwords.

Finally, There is really no fool-proof method in MSACC to prevent a knowledgeable user from bypassing anything you setup security wise. The closest I've found is in the post#6 link above. If you need anything very secure you'll need to move to an more mature RDMS>
Jun 8 '15 #2
Thanks a lot Zmbd for your help, but I think this is too much for me to chew. I will try and send the database across including some codes I have written to see if any of you can help.
Thank you.
Jun 10 '15 #3
zmbd
5,501 Expert Mod 4TB
You will find that many of the experts/moderators are either unable to open the attachments because we work in secured environments and provide help between tasks (ie - me :) ) or unwilling to open code from an unknown source.

Both links I provided go into a great bit of detail. If you get stuck on any of it we can provide guidance there... :)

TBH: your setup sounds a bit overly complex.
Jun 10 '15 #4

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

Similar topics

5
by: xah | last post by:
i'm just starting out on javascript. can anyone show me how to go about writing a code to sort a table column? something like the following: <table border="1"> <tr> <td>
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the...
0
by: M Bourgon | last post by:
I am trying to update the contents of table A (I'll use Northwind..Products as an example) with the data from any changed fields in Table B (which is a copy of Northwind..Products, but with some...
1
savanm
by: savanm | last post by:
Hi all, I have a problem to remove the particular fields in table... I have shown my code below: <?php $sql = "select * from login"; $ress = mysql_query($sql); //$res =...
1
by: shanthimanooj | last post by:
hi i need the code in qtp Compare two different Databases .that means comp two schemas no of tables,no of colums in a tables,no of rows in a table,
7
by: riceking | last post by:
Is it possible to do the following and if so, how? In one table, I have a list of email addresses I know are bad and no longer work. Another table has a list of companies with contact people,...
1
by: markroworth | last post by:
Hi there, I am trying to understand under what circumstances there would be in using a different table owner other than dbo. My DBA has (it seems arbitrariry) to use different table owners with no...
1
by: lipton | last post by:
how can i compare a mysql table feild value with selected redio button value with php
7
by: aannll | last post by:
hi: i want to compare the values that entered into text boxes with fields in table if it exists in the table i want to open page called (result) else open(voting) but when i run the program my...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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.