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. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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... |
#6
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|