Prevent a Duplicate Data Entry for Two Fields

How to Prevent a Duplicate Data Entry for Two Fields After we open an Add New Customer form, we have no idea how many customers in the database. We will see only the blank field to add new information. We don’t know if this customer is already in the database. If we don’t have a function to check it first then we may add a same customer name and address in the table twice. Related How To: How to Prevent a Duplicate Data Entry for Customer Name only In this…

Read More

How to Set Access VBA Password

Set Access VBA Password The VBA coding that comes out from your knowledge and put in under the button or On Load event procedure of form (shown below) in your Access program is your property. Sometime you don’t want to share your code to anyone or your co-worker. You can protect it with the password under the MS Visual Basic for Application (VBA). Follow the step below.     Step #1 Open your MS Access file and open the form design view and go to the form property. Click on…

Read More

Create Security Level in Access

 How to Set Security Level Before creating a form, you need to set up two tables that can differentiate the user type for each user in a User table. The step can be followed below: 1. Create a table tblSecurityLevel with a SecurityID and SecurityLevel field and add Admin for SecurityID =1 and User for SecurityID =2 2. Create a table tblUser with a UserID, UserName, UserLogin, and UserSecurity fields. We need to setup a table tblUser that has a UserSecurity field links to a table tlbSecurityLevel. So the data…

Read More

Create Login Form: MS Access

How to Create Login Form for MS Access Before creating a Login Form, you need to set up a table that can verify the login ID and password on the Login Form. The step of creating Login Form can be followed below: 1. Create a table tblSecurityLevel with a SecurityID and SecurityLevel field and add Admin for SecurityID =1 and User for SecurityID =2 2. Create a table tblWorker with a LoginID, Password and UserType fields. On my database, I setup a table tblWorker that has a UserType field links…

Read More

Set Security Level: MS Access

Enter VBA code on the on Load Event on Navigation Form Private Sub Form_Load() Dim Security As Integer Dim User As StringUser = Environ(“USERNAME”) Me.txtLogin = User Me.txtUser = DLookup(“userName”, “tblUser”, “[userLogin] = ‘” & User & “‘”) If IsNull(DLookup(“userSecurity”, “tblUser”, “[userLogin] = ‘” & Me.txtLogin & “‘”)) Then MsgBox “No Usersecurity set up for this user. Please contact the Admin”, vbOKOnly, “Login Info” Me.NavigationButton13.Enabled = False Else Security = DLookup(“Usersecurity”, “tblUser”, “[UserLogin] = ‘” & Me.txtLogin & “‘”) If Security = 1 Then Me.NavigationButton13.Enabled = True Else Me.NavigationButton13.Enabled = False End…

Read More