Printing a Tardy slip from a database

Posted on 2004-11-12
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
    LVL 8

    Accepted Solution

    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 33

    Assisted Solution

    by:Mike Eghtebas
    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

    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?
    LVL 8

    Expert Comment

    Thats what mine will do with the report.

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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now