Click to See Complete Forum and Search --> : barcode time in and function
zhuan li
Sep 10th, 2005, 09:57 PM
need help! I need to add the function to my database on scanning a barcode to record the time and deduct a value from a client. eg a student purchases a card with 20 lessons each time they enter and scan thier card thier time of entry is recorded and 1 lesson is deducted from thier total, when there is one lesson left a warning is displayed, thanks in advance
Richard
RobDog888
Sep 10th, 2005, 10:19 PM
Do you have your database table(s) created yet? You are using Access VBA (also, what year/version) or automating from VB6, VB.NET, C#, etc. What code so you have already?
zhuan li
Sep 10th, 2005, 10:44 PM
have tables created in access for all the basics not sure exactly what I need to record the time and ID and where to put it . Have a field on the main form which I want to accept the barcode scan, tried a table with IDnumber and TimeIn with the default as time() but whenever opening the main form and scanning barcode the last entry was over written.
RobDog888
Sep 10th, 2005, 11:32 PM
Are you doing this only in Access VBA or are you connecting to the DB using VB6 or ???
zhuan li
Sep 11th, 2005, 09:46 AM
only in access vba
RobDog888
Sep 11th, 2005, 01:01 PM
Ok, I guess you can have a table for holding each student. Then another table for their transactions. Table tblStudents and table tblTransactions. Table tblStudent would contain all the info about the student like - first name, last name, student id, etc. Table tblTransactions would contain info about each purchase - transactionID, student id, date/time, type, etc.
Then the Form would have a recordsource of either a join query between the two tables or just the transactions. When a student makes a purchase of a new 20 lession card the record will be entered in with a type field value of something like "Credit" and amount field of something like "20". Then when they do a transaction (they took a class or ???) the record entry would be type of "Debit" and amount field of "-1". Then you could easily add a SUM for a particular student to show how many they have left. ;)
RobDog888
Sep 11th, 2005, 01:06 PM
You will need a way to enter in each student too. So maybe an "Add" button or maybe a separate Form. This form would link directly to the tblStudents table and is easy to setup. Same with delteing a student on that same form.
Also, on your transaction form you would have an option to either designate it as a Credit (purchase) or a Debit. ;)
zhuan li
Sep 13th, 2005, 05:41 AM
Ok, after some problems and some rebuilding I now have
tblstudents
tbltransactions
tblproducts
tblemployees
I have assigned a credit value to each of the products e.g card-20 lessons, creditvalue 20. I guess when the card holder scans the card this needs to register as a transaction of some kind reducing the available credit amount by one ,how could I do this? and is it possible to record the ID and entry date at the same time? there will also be employees scanning to enter but only a record of date is required
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.