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
|
|||
|
|||
John Vinson is gone for two weeks can someone help me finish up this project?
I am almost there with John's help.
At one point when I put in the student ID it would just more all the student information up one I am a teacher and I would like to scan ID numbers from student ID's to only allow students that belong in my lunch in and keep the ones that don't belong in there out. I pulled a list of students into Access I have a barcode scanner to scan the student ID number into the computer which I have working. I want to scan the students ID cards with a barcoded ID number and bring up the students name, class, grade and lunch. The Table contains #-Primary Key | Student ID | Last Name | First Name | Grade | HR | Lunch | Class I have a form as per John W. Vinson directions I have a form with text boxes Student ID Text box name txtStudentID control source Student ID Lunch Text box name TxtLunch control source Lunch First Name Text box name TxtFirstName control source First Name Last Name Text box name TxtLastName control source Last Name Grade Text box name TxtGrade control source Grade Class Text box name TxtClass control source Class And and Unbound text box ID Scan TxtIDScan This is the code John gave me In this textbox's AfterUpdate event put the following VBA code. Click the ... icon by the After Update line on the Events tabl of the textbox's properties: Private Sub txtStudentID_AfterUpdate() Dim rs As DAO.Recordset Set rs = Me.RecordsetClone ' get the form's list of records rs.FindFirst "[Student ID] = '" & Me!txtStudentID & "'" If rs.NoMatch Then ' see if this ID exists MsgBox "Check this card, this ID was not found", vbOKOnly Else Me.Bookmark = rs.Bookmark ' open the found student's record End If This will, after you scan or type in the studentID, search the Form's recordset for the selected student; if they're found their information will be displayed, if not a message will pop up. |
#2
|
|||
|
|||
Apparently the scanned ID value is in the text box "TxtIDScan". If so then
your code should be: rs.FindFirst "[Student ID] = '" & Me!TxtIDScan & "'" Your code assumes the Student ID field is text, not numeric. Also, the scanned ID should go into the txtScanID text box and the code should be in the After Update of txtScanID not txtStudentID. -- Duane Hookom MS Access MVP wrote in message ... I am almost there with John's help. At one point when I put in the student ID it would just more all the student information up one I am a teacher and I would like to scan ID numbers from student ID's to only allow students that belong in my lunch in and keep the ones that don't belong in there out. I pulled a list of students into Access I have a barcode scanner to scan the student ID number into the computer which I have working. I want to scan the students ID cards with a barcoded ID number and bring up the students name, class, grade and lunch. The Table contains #-Primary Key | Student ID | Last Name | First Name | Grade | HR | Lunch | Class I have a form as per John W. Vinson directions I have a form with text boxes Student ID Text box name txtStudentID control source Student ID Lunch Text box name TxtLunch control source Lunch First Name Text box name TxtFirstName control source First Name Last Name Text box name TxtLastName control source Last Name Grade Text box name TxtGrade control source Grade Class Text box name TxtClass control source Class And and Unbound text box ID Scan TxtIDScan This is the code John gave me In this textbox's AfterUpdate event put the following VBA code. Click the ... icon by the After Update line on the Events tabl of the textbox's properties: Private Sub txtStudentID_AfterUpdate() Dim rs As DAO.Recordset Set rs = Me.RecordsetClone ' get the form's list of records rs.FindFirst "[Student ID] = '" & Me!txtStudentID & "'" If rs.NoMatch Then ' see if this ID exists MsgBox "Check this card, this ID was not found", vbOKOnly Else Me.Bookmark = rs.Bookmark ' open the found student's record End If This will, after you scan or type in the studentID, search the Form's recordset for the selected student; if they're found their information will be displayed, if not a message will pop up. |
#3
|
|||
|
|||
On Wed, 9 Feb 2005 22:05:32 -0600, "Duane Hookom"
wrote: Apparently the scanned ID value is in the text box "TxtIDScan". If so then your code should be: rs.FindFirst "[Student ID] = '" & Me!TxtIDScan & "'" Your code assumes the Student ID field is text, not numeric. Also, the scanned ID should go into the txtScanID text box and the code should be in the After Update of txtScanID not txtStudentID. If I put the code in AfterUpdate in ID Scan it appears in Student ID Afterupdate and if I remove it from Student ID it is removed from ID Scan? The Student ID and ID scan are numeric |
#4
|
|||
|
|||
Not trying to confuse the issue, so, if I'm off base here, just let me know
and I'll drop off... One "flaw" that I am perceiving here is that you're using the student's table as your form's Recordsource, but that will not help you to store which students were in lunch class on a certain day because that table does not appear capable of storing such data for each individual day. (Now, it may be that I am completely misunderstanding what you want, but this is what I was understanding from the other thread...it's not that you want to just show the student's info, but that you want to store that the student attended a particular lunch class on a particular date.) You're going to need a new table that will store the info for which students were in class: tblStudentsLunchAttend StudentID LunchDate The above table is the one that I would use for your form's RecordSource. Then the code for the barcode textbox would look up the info (does the barcode contain the actual Student ID value?) from your current table and display those values on the form for your info, but the barcode textbox would be bound to tblStudentsLunchAttend.StudentID field and you'd have another textbox with the date of the lunch class in it, and that date textbox would be bound to tblStudentsLunchAttend.LunchDate field. This "lookup code" would not use the FindFirst method of the form's recordset at all, because the form would not be bound to the table that contains the student data. Instead, I would use unbound textboxes for showing the student's name, grade, etc., and the control source for each of these display textboxes would be an expression similar to this (following is an example for the LastName of the student: =DLookup("Last Name", "ActualNameOfStudentTable", "[Student ID]=" & [txtIDScan]) -- Ken Snell MS ACCESS MVP wrote in message ... On Wed, 9 Feb 2005 22:05:32 -0600, "Duane Hookom" wrote: Apparently the scanned ID value is in the text box "TxtIDScan". If so then your code should be: rs.FindFirst "[Student ID] = '" & Me!TxtIDScan & "'" Your code assumes the Student ID field is text, not numeric. Also, the scanned ID should go into the txtScanID text box and the code should be in the After Update of txtScanID not txtStudentID. If I put the code in AfterUpdate in ID Scan it appears in Student ID Afterupdate and if I remove it from Student ID it is removed from ID Scan? The Student ID and ID scan are numeric |
#5
|
|||
|
|||
As Ken mentioned, if you want to save the student ID in a table with the
date, then you should not have a form based on the student table. I created an application similar to this a while back. You might not need any code. I would suggest a continuous form bound to Ken's suggested table. The LunchDate field is bound to a text box with a default value of either Date() or Now(). I would set the Tab Stop property to No for the date. The StudentID is bound to a combo box (cboStudentID) that has a Row Source of the student table. The bound column of the combo box must match the value you want to store in the table "tblStudentsLunchAttend". The columns in the combo box must contain all the fields you want to display on the form. If you want to display the Lunch field on the continuous form, make sure the combo box contains this field. You can then add a text box to the form with a control source like: =cboStudentID.Column(3) The column numbering is 0 based so Column(3) displays the value from the 4th column. When an ID is scanned in, it should place the student ID in the bound combo box and display any other columns in text boxes like the Lunch field. -- Duane Hookom MS Access MVP -- "Ken Snell [MVP]" wrote in message ... Not trying to confuse the issue, so, if I'm off base here, just let me know and I'll drop off... One "flaw" that I am perceiving here is that you're using the student's table as your form's Recordsource, but that will not help you to store which students were in lunch class on a certain day because that table does not appear capable of storing such data for each individual day. (Now, it may be that I am completely misunderstanding what you want, but this is what I was understanding from the other thread...it's not that you want to just show the student's info, but that you want to store that the student attended a particular lunch class on a particular date.) You're going to need a new table that will store the info for which students were in class: tblStudentsLunchAttend StudentID LunchDate The above table is the one that I would use for your form's RecordSource. Then the code for the barcode textbox would look up the info (does the barcode contain the actual Student ID value?) from your current table and display those values on the form for your info, but the barcode textbox would be bound to tblStudentsLunchAttend.StudentID field and you'd have another textbox with the date of the lunch class in it, and that date textbox would be bound to tblStudentsLunchAttend.LunchDate field. This "lookup code" would not use the FindFirst method of the form's recordset at all, because the form would not be bound to the table that contains the student data. Instead, I would use unbound textboxes for showing the student's name, grade, etc., and the control source for each of these display textboxes would be an expression similar to this (following is an example for the LastName of the student: =DLookup("Last Name", "ActualNameOfStudentTable", "[Student ID]=" & [txtIDScan]) -- Ken Snell MS ACCESS MVP wrote in message ... On Wed, 9 Feb 2005 22:05:32 -0600, "Duane Hookom" wrote: Apparently the scanned ID value is in the text box "TxtIDScan". If so then your code should be: rs.FindFirst "[Student ID] = '" & Me!TxtIDScan & "'" Your code assumes the Student ID field is text, not numeric. Also, the scanned ID should go into the txtScanID text box and the code should be in the After Update of txtScanID not txtStudentID. If I put the code in AfterUpdate in ID Scan it appears in Student ID Afterupdate and if I remove it from Student ID it is removed from ID Scan? The Student ID and ID scan are numeric |
#6
|
|||
|
|||
On Thu, 10 Feb 2005 09:05:03 -0500, "Ken Snell [MVP]"
wrote: Not trying to confuse the issue, so, if I'm off base here, just let me know and I'll drop off... One "flaw" that I am perceiving here is that you're using the student's table as your form's Recordsource, but that will not help you to store which students were in lunch class on a certain day because that table does not appear capable of storing such data for each individual day. (Now, it may be that I am completely misunderstanding what you want, but this is what I was understanding from the other thread...it's not that you want to just show the student's info, but that you want to store that the student attended a particular lunch class on a particular date.) You're going to need a new table that will store the info for which students were in class: tblStudentsLunchAttend StudentID LunchDate Before I make this table will it also store the students first and last name? The above table is the one that I would use for your form's RecordSource. Then the code for the barcode textbox would look up the info (does the barcode contain the actual Student ID value?) from your current table and display those values on the form for your info, but the barcode textbox would be bound to tblStudentsLunchAttend.StudentID field and you'd have another textbox with the date of the lunch class in it, and that date textbox would be bound to tblStudentsLunchAttend.LunchDate field. This "lookup code" would not use the FindFirst method of the form's recordset at all, because the form would not be bound to the table that contains the student data. Instead, I would use unbound textboxes for showing the student's name, grade, etc., and the control source for each of these display textboxes would be an expression similar to this (following is an example for the LastName of the student: =DLookup("Last Name", "ActualNameOfStudentTable", "[Student ID]=" & [txtIDScan]) |
#7
|
|||
|
|||
You guys are great but first you guys are putting the cart before the
horse. I still don't have the scanning of ID cards (which is the actual ID number in the table) to show the data in my form? What information can I give you so you can understand what is going on? I have a table with six text boxes that are bound to the ID, Lunch, First Name, Last Name, Grade and class and an unbound to scan in the ID number. On Thu, 10 Feb 2005 08:57:39 -0600, "Duane Hookom" wrote: As Ken mentioned, if you want to save the student ID in a table with the date, then you should not have a form based on the student table. I created an application similar to this a while back. You might not need any code. I would suggest a continuous form bound to Ken's suggested table. The LunchDate field is bound to a text box with a default value of either Date() or Now(). I would set the Tab Stop property to No for the date. The StudentID is bound to a combo box (cboStudentID) that has a Row Source of the student table. The bound column of the combo box must match the value you want to store in the table "tblStudentsLunchAttend". The columns in the combo box must contain all the fields you want to display on the form. If you want to display the Lunch field on the continuous form, make sure the combo box contains this field. You can then add a text box to the form with a control source like: =cboStudentID.Column(3) The column numbering is 0 based so Column(3) displays the value from the 4th column. When an ID is scanned in, it should place the student ID in the bound combo box and display any other columns in text boxes like the Lunch field. -- Duane Hookom MS Access MVP |
#8
|
|||
|
|||
There is no good reason to store the first and last names if you have the
studentid in the table tblStudentsLunchAttend. This is basic relational database usage. Look at the Northwind.mdb. In the OrderDetails table, you will see a productID but not a product name. The continuous form that I suggested will use a combo box bound to the StudentID but will actually display other fields from the student table. -- Duane Hookom MS Access MVP -- wrote in message ... On Thu, 10 Feb 2005 09:05:03 -0500, "Ken Snell [MVP]" wrote: Not trying to confuse the issue, so, if I'm off base here, just let me know and I'll drop off... One "flaw" that I am perceiving here is that you're using the student's table as your form's Recordsource, but that will not help you to store which students were in lunch class on a certain day because that table does not appear capable of storing such data for each individual day. (Now, it may be that I am completely misunderstanding what you want, but this is what I was understanding from the other thread...it's not that you want to just show the student's info, but that you want to store that the student attended a particular lunch class on a particular date.) You're going to need a new table that will store the info for which students were in class: tblStudentsLunchAttend StudentID LunchDate Before I make this table will it also store the students first and last name? The above table is the one that I would use for your form's RecordSource. Then the code for the barcode textbox would look up the info (does the barcode contain the actual Student ID value?) from your current table and display those values on the form for your info, but the barcode textbox would be bound to tblStudentsLunchAttend.StudentID field and you'd have another textbox with the date of the lunch class in it, and that date textbox would be bound to tblStudentsLunchAttend.LunchDate field. This "lookup code" would not use the FindFirst method of the form's recordset at all, because the form would not be bound to the table that contains the student data. Instead, I would use unbound textboxes for showing the student's name, grade, etc., and the control source for each of these display textboxes would be an expression similar to this (following is an example for the LastName of the student: =DLookup("Last Name", "ActualNameOfStudentTable", "[Student ID]=" & [txtIDScan]) |
#9
|
|||
|
|||
Do you want to store the information about which students were at which
lunch? Or, do you simply want to scan the card and display the student information on the screen? When the next student gets scanned, the previous student information is not viewable and not saved anywhere. -- Duane Hookom MS Access MVP -- wrote in message ... You guys are great but first you guys are putting the cart before the horse. I still don't have the scanning of ID cards (which is the actual ID number in the table) to show the data in my form? What information can I give you so you can understand what is going on? I have a table with six text boxes that are bound to the ID, Lunch, First Name, Last Name, Grade and class and an unbound to scan in the ID number. On Thu, 10 Feb 2005 08:57:39 -0600, "Duane Hookom" wrote: As Ken mentioned, if you want to save the student ID in a table with the date, then you should not have a form based on the student table. I created an application similar to this a while back. You might not need any code. I would suggest a continuous form bound to Ken's suggested table. The LunchDate field is bound to a text box with a default value of either Date() or Now(). I would set the Tab Stop property to No for the date. The StudentID is bound to a combo box (cboStudentID) that has a Row Source of the student table. The bound column of the combo box must match the value you want to store in the table "tblStudentsLunchAttend". The columns in the combo box must contain all the fields you want to display on the form. If you want to display the Lunch field on the continuous form, make sure the combo box contains this field. You can then add a text box to the form with a control source like: =cboStudentID.Column(3) The column numbering is 0 based so Column(3) displays the value from the 4th column. When an ID is scanned in, it should place the student ID in the bound combo box and display any other columns in text boxes like the Lunch field. -- Duane Hookom MS Access MVP |
#10
|
|||
|
|||
I want to do both but right now I have a form that if I put an ID
number in the ID Scan textbox it just moves the information in all the other textboxes to the next student in the table? I thought we could fix that first then work on saving the information or does it involve doing both to get the results I am looking for in the form? On Fri, 11 Feb 2005 08:45:40 -0600, "Duane Hookom" wrote: Do you want to store the information about which students were at which lunch? Or, do you simply want to scan the card and display the student information on the screen? When the next student gets scanned, the previous student information is not viewable and not saved anywhere. -- Duane Hookom MS Access MVP |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Project 2000 and Project server 2002 | K.V | General Discussions | 1 | January 21st, 2005 03:30 PM |
Many to many reationship design? | Dave | Database Design | 4 | January 18th, 2005 11:11 PM |
I am looking for a project planner, with start, finish dates and . | dv fanatic | General Discussion | 1 | November 27th, 2004 01:48 PM |
Union Query Not Returning A Value | Jeff G | Running & Setting Up Queries | 2 | October 19th, 2004 05:47 PM |
Signing a VBA mde/mdb Access 2003 | John Buckett | General Discussion | 3 | July 3rd, 2004 09:14 PM |