Help with form for a scan-in system

A

Andrea Martin

Last year I created a form to scan in student ids. That computer has been
"retired", so I need to recreate the form on our new computer -- and for the
life of me, I can't figure out how I did it.

The underlying table has two fields: ID & Date.
The form had just one text box: ID. The students scanned in their id cards,
the number was stored in the table (ID) with a date/time stamp (Date). I can
set that part up with no problem.

But the form was set up to move to a new record after the students scanned
their cards, and that's the part I can't remember how to set up. The
students didn't have to click a button or press enter. They just scanned
their cards, the number got entered, and the form advanced to the new record.

I barely new what I was doing when I created the form last year, have a
little more understanding now, but would appreciate if any help could be
phrased in "Form Coding For Dummies" language.
 
P

PC Datasheet

Two things:

1. ** Date is a reserved word in Access. Eventually you are going to run
into trouble using "Date" for a field name.
2. Check the documentation for your scanner. It needs to send a save
command after scanning each ID Card. Once you have this, put the following
code in the AfterUpdate event of the CardID textbox on your form:
DoCmd.RunCommand acCmdGoToRecord,,acNewRec
Me!CardID.SetFocus

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
 
A

Andrea Martin

"Date" -- Oops, forgot about that. Thanks for the heads up.

Not sure if the scanner sends a save command (it was an e-bay bargain
basement purchase; no documentation), but I'll certainly give your
suggestions a try. At worst, I could always add a click button -- but the
students liked the speed of "just scan & go."

Thanks very much for your time.
 
P

PC Datasheet

All scanners send a save command; even E-Bay bargain basement scanners just
for this purpose. You just need to find how to make it work.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
 
A

Andrea Martin

I can't get the form to advance to a new record.

Here's what I have in the textbox's AfterUpdate procedure:

CheckInTime = Now( )
DoCmd.Save 'I added this because the scanner might not send a save
command.

Beep
DoCmd.GoToRecord,,acNewRecord
Scan_Id_Here.SetFocus
End

Originally, I didn't have DoCmd.Save, but that didn't work either. Am I
doing something wrong?

Thanks very much.
 
A

Andrea Martin

Forgot to mention: CheckInTime = Now() and Beep work just fine. The only
thing that won't work is GoTo new record & reset focus.
 
P

PC Datasheet

You code is not correct for go to new record! Should be:
DoCmd.GoToRecord,,acNewRec

Double check the name of the textbox where you enter the StudentID. Be sure
it is "Scan_ID_Here". Then change your code to:
Me!Scan_ID_Here.SetFocus

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com

If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.
 
J

John Marshall, MVP

PC Datasheet said:
If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee. Over 1000 Access users have come to me for help.


So how many of the 1000 came to you expect free help and how many did you
actually work for?

So why should they contact you if you can not provide help them in the
newsgroup? This newsgroup is provided by MS for free peer to peer support
not your personal hunting ground for money.

John... Visio MVP
 
A

Andrea Martin

Hi guys,
Actually, I'm sure my code says acNewRec since I used the auto fill-in
feature in Access (whatever that feature's called).

I googled to find my original post from last year. John Vincent recommended
setting the AutoTab feature to true. I'll bet that's the ticket as tabbing
out of the first control should trigger the AfterUpdate, right?

Will give it another whirl at work tomorrow.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top