Prompt or Sound for Scan of Wrong Lunch Period

  • Thread starter Thread starter Me
  • Start date Start date
M

Me

Is there any way that I can have a prompt or sound come up if I scan
in an ID that does not belong in the lunch I am scanning for?

I am scanning student ID's for the lunch I am working. There are three
lunches (3A, 3B, and 3C) and I would like a dialog box or even a sound
to show if I scan in an ID that does not belong in 3C lunch.
 
hi,
I don't know how your table(s) are set up but DLookup
comes to mind. you would have to have a way to tell access
what lunch it is currently. maybe a text box on your form.

If isnull(Dlookup("[StudentID]","yourtable","catagory = '"
& me.catagorytextbox & "'" then
MsgBox ("Something")
end if

note: the isnull(DLookup) wrapped. suppose to by 1 line.
DLookup will return a value if it can find a match. It
returns null if it cannot find a match. if it returns
null, the above will display a message. you got em. you
could put the code in the student id text box's before
update event.
Post back if you have question/Problems
 
Back
Top