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 |
#12
|
|||
|
|||
Check for non-exiting IDs
You rock! This helped me out too!
"Steve" wrote: 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... |
|
Thread Tools | |
Display Modes | |
|
|