472,328 Members | 1,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Fw: Compare textbox value to record in table

Excuse the re-post but I have found something which works for the UserID
but not for the Password (see previous post below). The problem is I don't
understand how it works and therefore cannot update it to do as I need.
Could someone explain A) how to modify this to make sure the username &
password are valid or B) How the below works so I can do it myself. I have
never seen "PARAMETERS" used before in SQL which has thrown me completely.

The function I'm using for the UserID is:

Option Compare Database

Function ValidUserIDDAO(strUserID As String) As Boolean
Dim loDB As DAO.Database
Dim loQdf As DAO.QueryDef
Dim loRst As DAO.Recordset

Set loDB = CurrentDb
Set loQdf = loDB.QueryDefs("qry_validate_userid")
With loQdf
.Parameters(0) = strUserID
Set loRst = .OpenRecordset
End With

With loRst
ValidUserIDDAO = Not (.EOF And .BOF)
End With
Set loRst = Nothing
Set loQdf = Nothing
Set loDB = Nothing
End Function
The SQL I use is:

PARAMETERS TestUserID Text ( 255 );
SELECT tbl_user_id.UserID
FROM tbl_user_id
WHERE (((tbl_user_id.UserID)=[TestUserID]))

I then call the function in the after update event of the UserID textbox:

If Not ValidUserIDDAO(Me.txt_user_id.Value) Then..........



----- Original Message -----
From: "Mark" <ma**********@ntlworld.com>
Newsgroups: comp.databases.ms-access
Sent: Monday, January 31, 2005 7:00 AM
Subject: Compare textbox value to record in table

Hi All,

Win XP, Office XP
What I am trying to do is create a login form. The problem is that I am
going to set the database up using Access security so that only admin
can read the tables. I plan to have all info coming from stored queries
"With OwnerAccess". With this in mind, what I am trying to do is: In the
afterupdate event of the username and password fields, look for the
existence (either true or false) of the username for the userid textbox
the username & password for the password textbox.

My understanding of VB is very limited but from what I can make out, I
to reference the result stored query/s.
Could anyone point me in the right direction please.

My table layout (Tbl_Users) is as follows:
Userid text PRIMARY KEY
Name text
Pwd text
Disabled yes/no
Security_level number
Ixxluda date/time



Nov 13 '05 #1
0 2290

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Gleep | last post by:
Hey Guys, I've got a table called Outcomes. With 3 columns and 15 rows 1st col 2nd col 3rdcol outcome ...
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...
by: Mark | last post by:
Hi All, Win XP, Office XP What I am trying to do is create a login form. The problem is that I am going to set the database up using Access...
by: dskillingstad | last post by:
I'm trying to assign a custom value to a textbox. Here's what I have. I've created a module and "default value" code for a textbox which...
by: Johann Blake | last post by:
I have a form with a single textbox control which is bound to a DataRelation in a typed dataset. The textbox displays the name of the product...
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid...
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that...
by: Pourya99 | last post by:
Hello, I have an Access Data Access Page which has a pivot table. The data source of the pivot table is a SQL database table. The data in the...
by: tuxalot | last post by:
I have a textbox, on with a record source . FrmMain is a tabbed form showing injury data for a given EmployeesID. I have a textbox, on a subform...
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...

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.