473,405 Members | 2,444 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,405 software developers and data experts.

MS Access Log in through security question and answer

12
I have a table : tblEmployees having lngEmpID(autonumber), strEmpName(text), SecurityQuestion(number-look up from another table) and SecurityAnswer(text).
I am trying to create a log-in form by selecting Employee name from one combo box(cboEmployeeQ)and security question from another combo box(cmbSecQ); and putting security answer in another textbox(txtSecAns) and a command button(cmdLoginQ) to log-in.
I have written the vb code(I have taken help from another post):
Private Sub cmdLoginQ_Click()
Dim t As Variant
t = DLookup("SecurityAnswer", "tblEmployees", _
"[lngEmpID]=" & Me.cboEmployeeQ.Value)
Dim u As Variant
u = DLookup("SecurityQuestion", "tblEmployees", _
"[lngEmpID]=" & Me.cboEmployeeQ.Value)



'Close logon form and open splash screen

If Me.txtSecAns.Value = t And Me.cmbSecQ = u Then
DoCmd.OpenForm "frmSplashScreen1"
DoCmd.Close acForm, "User", acSaveNo


Else
MsgBox "Security Question and Answer Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.txtSecAns.SetFocus
End If

End Sub
....
But its not working- it always shows msgbox:"Security Question and Answer Invalid. Please Try Again"- as written if employee record does not match

Kindly help.
Nov 26 '16 #1
1 921
PhilOfWalton
1,430 Expert 1GB
In debug mode, what value are you getting for Me.cmbSecQ. Are you getting a number or are you getting the question?
Check what value you get from Me.cmbSecQ.Column(1) or check to see which is the bound column.

Incidentally , I would not use the word .Value in your expression. It should not be neccessary.

Phil
Nov 27 '16 #2

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

Similar topics

1
by: Struggling Coder | last post by:
We have a database here at work and the person who created has been gone for two years. The original project manager wants to use this database on his New project, but the database is secured. I...
0
by: lewang | last post by:
I am trying to get data from Access through a SQL query from Excel via VBA: but i get an error of "Run Time Error '-2147467259 (800040005)': Method 'Open' of object '_Recordset' failed" I have...
2
by: mbsevans | last post by:
New user here. I have constructed a database to track basic employee information. I wish to place finished database on a the network. I need to obviously retain full admin persmissions for all...
2
by: menmysql | last post by:
hi to all, i want to know how to access myproject through LAN. right now we are accessing in a stand alone system now we want to access through LAN like a clint server system. in order to access...
1
by: ashok1986 | last post by:
hi every one i had developed a vb.net application. I tried to access through a remote computer but i get an error like this plz any one help . "Application attempted to perform an operation not...
4
by: vincent90152900 | last post by:
How to remove Security Question and Security Answer from membership provider? Following is my codes. Please tell me how to remove Question and Answer from membership provider. Thank you for...
2
by: sukhhvinder | last post by:
Hi, I am using vb 2005 express edition. So how can i serach for particular record in MS Access through vb.net Thanks Sukhvinder
0
by: Tony Toews [MVP] | last post by:
Folks To make a long story short Office 2000 security patches are *not* included in the Microsoft Update. Although you can find them in the rather unobtrusive Office Update. For an...
1
by: Prasu TKP | last post by:
I have developed an Access Application and given to the pople to work through 'Share folder'. There are six people using every day. I have disabled the byepass key also. Very recently one peson...
1
by: Ashok Parhi | last post by:
Ia m aun able to connect the MS access through Wamps5 1.7.3 Here is the code <?php // Two versions of Microsoft Office. Choose one. //$db = 'C:\EmployeeDetails.mdb'; $db =...
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
Oralloy
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,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.