Printing a Tardy slip from a database

Hello,

I have a question,  I have a database that holds the information on students at an elementary school. I would like to create a form, query, or macro that prints out a tardy slip that contains the student name, ID #, date and time. I was wondering if this was possible by just inputting the student's name or ID # and the form adding the rest to the form?

I would appreciate any help on this

fool5683Claims SpecialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SimonLarsenCommented:
Yeah this ought to be quite doable, probably need a little more info though.

Assuming that there is a table called Student with fields StudentName, ID

Assuming you want the current date and time to be on the tardy slip?

So make a little form with a text box for the StudentName and one for the Student ID#

Whack a button on there called btnGo

Save that form.

Make a report that has the layout and everything you want. If you use the wizard and base the report on the Student table.

In design mode of the report put a control with a default value of = Now()

Print it out and play around til it is the way you want it.

Now open the form, go to design and right click / build event on the button.

Put in

dim s as string

if not isnull (me.StudentID) then s = "StudentID = " & me.StudentID

DoCmd.OpenReport "TardySlip", , , s

Now see how it works. I have made a bunch of assumptions here and could be way off base so feel free to hurl insults etc my way ;)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike EghtebasDatabase and Application DeveloperCommented:
Select [student name], [ID #], [date and time] From MyTable Where [ID #]=[Enter Student ID:] and [TardyYN]= True

1. Change above field and table names to what you have.

2. If there is no [TardyYN] field (meaning the table itself is tblTardy for example), remove "and [TardyYN]= True" from the end of above SQL.

3. Start a new query and add a table (any table) to it.  And Select View/SQL from the menu.

4. Replace its content with above SQL (after doing step 1 above of course).

5. Run the query.  It will prompt you with  "Enter Student ID:" question.  Enter a valid ID and see the result.

We can add student name later on giving you the option of either one.  

Do you have a form where you can have a combo box in it from which you can select student name or ID instead of typing it?

Mike
0
fool5683Claims SpecialistAuthor Commented:
I will try this out and get back to you. I dont have a form yet, but have been considering a combo box. What do you think about using a subform has the date/time field supplied automatically (Now( ) Command) and the student ID and Name field and a button that just prints the subform as long as the Name and ID fields are valid? Can that be accomplished in Access?
0
SimonLarsenCommented:
Thats what mine will do with the report.

"In design mode of the report put a control with a default value of = Now()"

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.