A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Check for non-exiting IDs



 
 
Thread Tools Display Modes
  #1  
Old July 26th, 2007, 04:56 PM posted to microsoft.public.access.forms
Ricoy-Chicago
external usenet poster
 
Posts: 89
Default Check for non-exiting IDs

The school I worked at wants me to create an application so student can fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student ID
(this is type in a text box), then he/she clicks in a command button to start
the survey. The command button should check that if it is a valid ID then
the survey screen should be displayed if not a message box will be displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the table then
it is an invalid ID.

Thank you for your help...

  #2  
Old July 26th, 2007, 05:06 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP]
external usenet poster
 
Posts: 4,231
Default Check for non-exiting IDs

The answer is easy, and may be done several different ways Before we write
some code for you, what you want to do after it returns OK, (Open a specific
form, etc.) and what happens if (or when) the student types someone else's
ID by mistake and that ID does, in fact, exist?
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Ricoy-Chicago" wrote in message
...
The school I worked at wants me to create an application so student can
fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student ID
(this is type in a text box), then he/she clicks in a command button to
start
the survey. The command button should check that if it is a valid ID then
the survey screen should be displayed if not a message box will be
displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the table
then
it is an invalid ID.

Thank you for your help...



  #3  
Old July 26th, 2007, 05:22 PM posted to microsoft.public.access.forms
Ricoy-Chicago
external usenet poster
 
Posts: 89
Default Check for non-exiting IDs

If the ID is a valid one, then a new form (the survey) should be opened.

If the ID is invalid the "Splash" screen remains open an a Msgbox is
displayed.

If the ID is entered wrong three times the application terminates
automatically (I can do this one once I know how to check for an invalid ID)

Not every student will be filling surveys at the same time, the number of
students doing the survey at the same time will be less than 15.

If the student has filled-out a survey a yes/no field is set by my coding.

I am assuming that the chances that a student enters someone else's is very
slim. I could ask for SSN, the surveys are confidential but students might be
adamant about providing their SSN. (surveys will be about classes and
instructors' evaluations)

I hope this helps.

Arvin Meyer [MVP]" wrote:

The answer is easy, and may be done several different ways Before we write
some code for you, what you want to do after it returns OK, (Open a specific
form, etc.) and what happens if (or when) the student types someone else's
ID by mistake and that ID does, in fact, exist?
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


"Ricoy-Chicago" wrote in message
...
The school I worked at wants me to create an application so student can
fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student ID
(this is type in a text box), then he/she clicks in a command button to
start
the survey. The command button should check that if it is a valid ID then
the survey screen should be displayed if not a message box will be
displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the table
then
it is an invalid ID.

Thank you for your help...




  #4  
Old July 26th, 2007, 07:12 PM posted to microsoft.public.access.forms
Ricoy-Chicago
external usenet poster
 
Posts: 89
Default Check for non-exiting IDs

Any Help out there. . .

"Ricoy-Chicago" wrote:

The school I worked at wants me to create an application so student can fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student ID
(this is type in a text box), then he/she clicks in a command button to start
the survey. The command button should check that if it is a valid ID then
the survey screen should be displayed if not a message box will be displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the table then
it is an invalid ID.

Thank you for your help...

  #5  
Old July 26th, 2007, 08:25 PM posted to microsoft.public.access.forms
Steve[_10_]
external usenet poster
 
Posts: 608
Default Check for non-exiting IDs

Assumimg StudentID is numeric, put the following code at the beginning of
your code for the command button:

Dim DB as DAO.Database
Dim Rst As DAO.Recordset
Set DB = CurrentDB()
Set Rst = DB.OpenRecordset("TblStudent")
Rst.FindFirst "[Student] = " & Me!NameOfStudentIDTextBox
If Rst.NoMatch Then
GoTo ExitHere
End If

Put the following code right above End Sub:
ExitHe
Set DB = Nothing
Rst.Close
Set Rst = Nothing

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications



"Ricoy-Chicago" wrote in message
...
The school I worked at wants me to create an application so student can
fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student ID
(this is type in a text box), then he/she clicks in a command button to
start
the survey. The command button should check that if it is a valid ID then
the survey screen should be displayed if not a message box will be
displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the table
then
it is an invalid ID.

Thank you for your help...



  #6  
Old July 26th, 2007, 08:50 PM posted to microsoft.public.access.forms
Ricoy-Chicago
external usenet poster
 
Posts: 89
Default Check for non-exiting IDs

Steve,

I copy/paste your code and change text to my own data. when I try to run it
the message:

Complie error:
User-defined type not defined

is displayed and the text : "DB as DOA.Database" is highilighted int eh VBA
Screen.

Please help... Thank you

"Steve" wrote:

Assumimg StudentID is numeric, put the following code at the beginning of
your code for the command button:

Dim DB as DAO.Database
Dim Rst As DAO.Recordset
Set DB = CurrentDB()
Set Rst = DB.OpenRecordset("TblStudent")
Rst.FindFirst "[Student] = " & Me!NameOfStudentIDTextBox
If Rst.NoMatch Then
GoTo ExitHere
End If

Put the following code right above End Sub:
ExitHe
Set DB = Nothing
Rst.Close
Set Rst = Nothing

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications



"Ricoy-Chicago" wrote in message
...
The school I worked at wants me to create an application so student can
fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student ID
(this is type in a text box), then he/she clicks in a command button to
start
the survey. The command button should check that if it is a valid ID then
the survey screen should be displayed if not a message box will be
displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the table
then
it is an invalid ID.

Thank you for your help...




  #7  
Old July 26th, 2007, 09:22 PM posted to microsoft.public.access.forms
Steve[_10_]
external usenet poster
 
Posts: 608
Default Check for non-exiting IDs

You mistyped that line of code. Here is what I gave you:
Dim DB as DAO.Database

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications






"Ricoy-Chicago" wrote in message
...
Steve,

I copy/paste your code and change text to my own data. when I try to run
it
the message:

Complie error:
User-defined type not defined

is displayed and the text : "DB as DOA.Database" is highilighted int eh
VBA
Screen.

Please help... Thank you

"Steve" wrote:

Assumimg StudentID is numeric, put the following code at the beginning of
your code for the command button:

Dim DB as DAO.Database
Dim Rst As DAO.Recordset
Set DB = CurrentDB()
Set Rst = DB.OpenRecordset("TblStudent")
Rst.FindFirst "[Student] = " & Me!NameOfStudentIDTextBox
If Rst.NoMatch Then
GoTo ExitHere
End If

Put the following code right above End Sub:
ExitHe
Set DB = Nothing
Rst.Close
Set Rst = Nothing

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications



"Ricoy-Chicago" wrote in message
...
The school I worked at wants me to create an application so student can
fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student ID
(this is type in a text box), then he/she clicks in a command button to
start
the survey. The command button should check that if it is a valid ID
then
the survey screen should be displayed if not a message box will be
displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the table
then
it is an invalid ID.

Thank you for your help...






  #8  
Old July 26th, 2007, 09:40 PM posted to microsoft.public.access.forms
Ricoy-Chicago
external usenet poster
 
Posts: 89
Default Check for non-exiting IDs

Corrected typo... still same error... time to go home, I'll try tomorrow...

"Steve" wrote:

You mistyped that line of code. Here is what I gave you:
Dim DB as DAO.Database

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications






"Ricoy-Chicago" wrote in message
...
Steve,

I copy/paste your code and change text to my own data. when I try to run
it
the message:

Complie error:
User-defined type not defined

is displayed and the text : "DB as DOA.Database" is highilighted int eh
VBA
Screen.

Please help... Thank you

"Steve" wrote:

Assumimg StudentID is numeric, put the following code at the beginning of
your code for the command button:

Dim DB as DAO.Database
Dim Rst As DAO.Recordset
Set DB = CurrentDB()
Set Rst = DB.OpenRecordset("TblStudent")
Rst.FindFirst "[Student] = " & Me!NameOfStudentIDTextBox
If Rst.NoMatch Then
GoTo ExitHere
End If

Put the following code right above End Sub:
ExitHe
Set DB = Nothing
Rst.Close
Set Rst = Nothing

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications



"Ricoy-Chicago" wrote in message
...
The school I worked at wants me to create an application so student can
fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student ID
(this is type in a text box), then he/she clicks in a command button to
start
the survey. The command button should check that if it is a valid ID
then
the survey screen should be displayed if not a message box will be
displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the table
then
it is an invalid ID.

Thank you for your help...







  #9  
Old July 26th, 2007, 10:08 PM posted to microsoft.public.access.forms
Steve[_10_]
external usenet poster
 
Posts: 608
Default Check for non-exiting IDs

Open to the code. Go to Tools - References. Uncheck Microsoft ADO. Scroll
down and find Microsoft DAO with the highest version number. Check it.
Clsoe. Open Tools - References again. Microsoft DAO should now be in the
list and checked. Close. Try runnning the code again.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications





"Ricoy-Chicago" wrote in message
...
Corrected typo... still same error... time to go home, I'll try
tomorrow...

"Steve" wrote:

You mistyped that line of code. Here is what I gave you:
Dim DB as DAO.Database

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications






"Ricoy-Chicago" wrote in message
...
Steve,

I copy/paste your code and change text to my own data. when I try to
run
it
the message:

Complie error:
User-defined type not defined

is displayed and the text : "DB as DOA.Database" is highilighted int eh
VBA
Screen.

Please help... Thank you

"Steve" wrote:

Assumimg StudentID is numeric, put the following code at the beginning
of
your code for the command button:

Dim DB as DAO.Database
Dim Rst As DAO.Recordset
Set DB = CurrentDB()
Set Rst = DB.OpenRecordset("TblStudent")
Rst.FindFirst "[Student] = " & Me!NameOfStudentIDTextBox
If Rst.NoMatch Then
GoTo ExitHere
End If

Put the following code right above End Sub:
ExitHe
Set DB = Nothing
Rst.Close
Set Rst = Nothing

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications



"Ricoy-Chicago" wrote in
message
...
The school I worked at wants me to create an application so student
can
fill
school surveys in the computer.

Using Acees 2000, F/E, B/E files tables, forms queries etc. I have
everything ready except for one thing:

I have a "splash" screen where the student will type his/her student
ID
(this is type in a text box), then he/she clicks in a command button
to
start
the survey. The command button should check that if it is a valid
ID
then
the survey screen should be displayed if not a message box will be
displayed.
I have a table with the Student ID and student's personal info.
I have no problem creating any of this my problem is:

How can I check if the Student ID is a valid one?

For example if the student types: 1000 and that ID is not in the
table
then
it is an invalid ID.

Thank you for your help...









  #10  
Old July 26th, 2007, 10:14 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Check for non-exiting IDs

On Thu, 26 Jul 2007 13:40:02 -0700, Ricoy-Chicago
wrote:

Corrected typo... still same error... time to go home, I'll try tomorrow...


PMFJI...

Open the VBA editor; on the menu select Tools... References. Scroll down and
check

Microsoft DAO x.xx Object Library

(check the highest version if there are more than one).

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.