How to read data from Access Table ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I'm new to Access programming. I created a table called "UserName" contains
3 fields: UserID, Last Name and First Name.

I asked user to input their User ID into a field named "InputID" which is a
string:

Can someone shown me a SQL or other statement on how to:
1 - Open the UserName table
2 - Use a SQL statement to check if the entered user (stored in "InputID")
exist in the UserName table which contains a list of different user.

Here is the algorithm that I have in mind:
Open UserName table
SQL statement to check if the inputID exist in the UserName table <- this is
where I need help on what the SQL statement look lik
If exist then <-- need help on how to check if the SQL statement finds the
user
do something
else
prompt error msg
endif
 
Use DLookup() to see if the UserID exists in the table.
Use IsNull() to test if the result is null, i.e. the value was not found.

Details of how to build the statement in:
Getting a value from a table: DLookup()
at:
http://allenbrowne.com/casu-07.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top