Hi,
when i run the code my second if condition is not checking the table wether user have admin access or not.
after checking 2nd condition its directly moving to else statement. please help me. - If Me.Text13.Value = DLookup("EMP_PW", "M_EMPINFO", "[EMP_NO]=" & Me.Combo2.Value) Then
-
If Me.Combo2.Value = DLookup("emp_no", "m_empinfo", "admin_access" = yes) Then
-
DoCmd.OpenForm "UserAccess_Form", acNormal, "", "", acFormAdd, acNormal
-
Else
-
do something
3 955 zmbd 5,501
Expert Mod 4TB
Slightly alter your code: - '(...partial air code...)
-
'(...some things left out...)
-
'
-
'Two variables as variant to handle null/zero
-
Dim varFirstValue As Variant
-
Dim varSecondValue As Variant
-
'
-
'(...some things left out...)
-
'Pull your lookups
-
varFirstValue = DLookup("EMP_PW", "M_EMPINFO", "[EMP_NO]=" & Me.Combo2.Value)
-
varSecondValue = DLookup("emp_no", "m_empinfo", "admin_access" = yes)
-
'
-
'Now let's see what was returned, personally, I'd put some code in here to check for bad returns; however, for TS... the debug.print will do for now...
-
debug.print "FirstValue = " & varFirstValue
-
debug.print "SecondValue = " & varSecondValue
-
'
-
'Now once you know what is being returned by the functions and you have done proper error checking, THEN you can use these values:
-
If Me.Text13.Value = varFirstValue Then
-
If Me.Combo2.Value = varSecondValue Then
-
DoCmd.OpenForm "UserAccess_Form", acNormal, "", "", acFormAdd, acNormal
-
Else
-
do something
One should ideally never pull data without checking the returned data FIRST.
You should not be storing passwords in plain text like this. It is a huge security risk.
zmbd 5,501
Expert Mod 4TB
Rabbit is absolutely correct, and something I was remiss in not mentioning... and there are several helpful insight articles that might help with that issue. One such would be: SHA2 Cryptographic Hash Algorithm for VBA and VBScript
There are a couple of others in the list too...
Sign in to post your reply or Sign up for a free account.
Similar topics
by: tchangmian |
last post by:
I want to limit user login by writing ASP program. In details, if a
user had logged in wrongly for more than three times, then the user
will not be abled to log in to the system anymore even...
|
by: BD |
last post by:
Hi, all:
I have been tasked with determining how many licenses of a certain SQL
Server 2000-based application are actually in use: in other words,
record or log connections made to the database...
|
by: Kirk Groome |
last post by:
Hi all,
I'm working on a web site and I would like to use the VS login controls. The
problem I'm having is that when I create a new user all works fine. The user
gets added to the database and...
|
by: Rotsey |
last post by:
Hi,
I have a web site dev with VS2003, .NET 1.1.
I am persisting the login with the statement below
When I login and then close the browser repoen it
works fine. But when I leave the session...
|
by: shaun.laughton |
last post by:
Hi All.
I am new to ASP.NET 2.0 development, and am writing a small
application to log time and expenses for projects.
I have successfully set up Membership, Role and Profile providers
using...
|
by: Uwe |
last post by:
Hi,
I'm currently developing an ASP.NET application with my own
MembershipProvider. Login works fine on my local machine (IIS7) in a virtual
directory of IIS. I just deployed the application to a...
|
by: samatair |
last post by:
Hi Enthusiasts of programming
I need to do system where in php and mysql system where the users have different roles and
they are given differnt privileges. example
when an admin logs in he has...
|
by: gbaii |
last post by:
Hi all. Being new to access and wanting to build some kind of basic CRM software, I have the following problem. I have a table called users with the fields: UserID, UserName, UserPass and UserType....
|
by: bradleyhogan |
last post by:
I had implemented urlrewritingnet successfully but after adding forms
authentication, none of the login controls work on the rewritten
pages.
<add name="Keyword" virtualUrl="^~/(.*)"...
|
by: TravelingCat |
last post by:
Hi,
My program contains events, each event has several assignments (displayed on the same form, in a subform).
Each assignment has a checkbox, it's checked to send mail to "assignInCharge" to...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |