[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Printing a Tardy slip from a database

Posted on 2004-11-12
Medium Priority
Last Modified: 2006-11-17

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

Question by:fool5683
  • 2

Accepted Solution

SimonLarsen earned 1600 total points
ID: 12571935
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 ;)
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 400 total points
ID: 12571984
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?


Author Comment

ID: 12574400
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?

Expert Comment

ID: 12574459
Thats what mine will do with the report.

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


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question