Results 1 to 12 of 12
  1. #1
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42

    Question Check of the students every day

    Hi




    I have a table with the students names and personal info. Every morning we do a check of who has shown up. Is it possible to make a form created of todays date, that lists the students with a checkbox? And how does the table save that information? Do I need a different table structure?


    Thank you for your qualified help.

  2. #2
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Going through you thread I assume you have the following requirements:
    1) There is a List of students that you have to check present every day.
    2) You want to Run a report on the for a particular date or a date range to find the number of strdents present on that day.

    This is what I have done.

    Tables:
    Student:{ID Autonumber(PK), StudentName,Present(Yes/No),P_Date}
    Main: With the same set of Fields.

    Now I have created a Form called Form1. It is a Continous Form with all the Names of Students. There is a text box at the Form Header. The User Needs to Type a date in it and Check present For all the students that are present and Click the Append Data Button:

    This is the Code attached to the Button:

    Private Sub Command10_Click()
    On Error GoTo Err_Command10_Click
    Dim strMessage As String
    Dim AppendSQL As String
    Dim UpdateSQL As String
    Dim strUpdateDate As String

    If IsNull(Me.Text7) Then 'Checks if Date is entered
    MsgBox "Please enter a Date", vbInformation, "No Date"
    Else
    strMessage = MsgBox("Do you want to append data", vbInformation + vbYesNo, "Data Append") 'Option provided to the user to either append or to abort
    Select Case strMessage
    Case vbYes

    DoCmd.GoToRecord , , acFirst 'Goes to the First Record on the Form

    strUpdateDate = "Update student Set P_Date=#" & Me.Text7 & "#;" 'Updates P_Date to the date typed in the text box in the student table
    CurrentDb.Execute strUpdateDate

    'Appends the data into the main table

    AppendSQL = "INSERT INTO Main ( StudentName, Present, P_Date ) SELECT Student.studentName, student.Present, student.P_Date FROM Student Where P_Date=#" & Me.Text7 & "#;"
    CurrentDb.Execute AppendSQL


    Case vbNo
    MsgBox "Abort", vbInformation, "Action Canceled"
    End Select
    UpdateSQL = "Update Student SET Present=False,P_Date=Null;" 'Clears sttudent table
    CurrentDb.Execute UpdateSQL
    Me.Text7 = Null
    Me.Requery
    End If
    Exit_Command10_Click:
    Exit Sub
    This code does the following Things:
    1) ensures that date is typed.
    2) Update the P_Date of Student Table.
    3) Appends all data pertaining to that date in the Main table.

    Explanation:

    The P_Date in student column is updated to the date you have typed. Now when you check the Present check box the child is present for the day and if it is not checked that means te child is absent. this information is then appended to the main table.

    Now yu just have to prepare a report based on he Main Table to take out the Report of students present or absent.

    I have prepared a report the P_Date criteria is set to Between [Type:Starting date] And [Type:End date] so you can see the report for a date range. For a particular date Starting and ending date will be the same.

    Setting the Criteria for the Field Present True/False can give you the strudents present and absent.

    attaching an mdb file for your reference.

  3. #3
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    Woow, again you have given me great help! Thx alot! ;-)



    I have a question for the report: How will I make a report that has all dates in the four weeks course, and have them listed on one pages with the studentīs name as a header? I need a paperprint that the student needs to sign at the end of the course. So his name in the top and the registration info on the rest of the page. Is there some kind of PageBreak-function?

  4. #4
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    First of all if your initial problem is solved mark the thread solved as this will help other having the same problem. I am looking into the report options right now.

  5. #5
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    "Students name as Header" I assume you report to have the following Format
    ************** Student Name**********

    01/05/2010******** Present
    01/06/2010******** Absent
    01/07/2010******** Present
    01/08/2010******** Present

    Signature

    The astrix are spaces.

    let me know if I am right.

  6. #6
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    Yes, kinda like that.

    The report should contain all the feilds like the file I sent you. The student and teacher will be able to see, if there has been any comments to the days - like "I arrived later because of heavy traffic", "I have to go to the doctor", etc. So, each report should contain all available information of each day. Absent or present, comments and so on.

  7. #7
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    How can I make a combobox, that makes a filtre on the entries?

    Like this: I choose between the teams startdates in the combo and the students, who are on this particular team is shown. And I would like to have the date feild in the top to show the current date. I get an error msg when I try to make the standard value date()...?

    (Do you want me to make a new thread?

  8. #8
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    Well this is What I assume that you might be wanting.

    Place a combobox on the form. Select a value in it and the form will show the data corresponding to that value is that what you want if yes let me know.

  9. #9
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    The student.zip you posted on this thread is what I use. I would like a combo besides the append data-buttom. It should contain the teamīs startingdates. When a date is chosen in the combobox, the students will be listed according to that date.

    Second:
    The date-feild next to append-buttom is empty when the form load. Could be so, that it always shows the current date as a standard value, and then is changeable if needed?

  10. #10
    carstenhdk is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2010
    Location
    Denmark
    Posts
    42
    The second tihing I asked for is not a problem anymore. ;-)

  11. #11
    maximus's Avatar
    maximus is offline Expert
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Aug 2009
    Location
    India
    Posts
    931
    here us a small sample that I have made for you. I have used a combo box to select a value and the used the same value as a criteria for a Select query that I have used as the record source of my form. I have a label on the form and to the onclick event of the same I have a code that removes the filter check it out

  12. #12
    Faisal2021 is offline Novice
    Windows 7 Access 2007
    Join Date
    May 2010
    Posts
    1

    Attach

    I can't download the file.

    Thank you for every thing

Please reply to this thread with any new information or opinions.

Similar Threads

  1. To check or Un-Check all Boxes in a form
    By devcon in forum Forms
    Replies: 7
    Last Post: 05-01-2010, 12:03 AM
  2. Replies: 1
    Last Post: 01-06-2010, 10:32 AM
  3. Students
    By Rohit0012 in forum Reports
    Replies: 8
    Last Post: 10-27-2009, 04:04 AM
  4. Check Box Value
    By mulefeathers in forum Programming
    Replies: 4
    Last Post: 10-09-2009, 08:31 PM
  5. New database - Students related DB
    By Hayat in forum Database Design
    Replies: 0
    Last Post: 07-29-2009, 07:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums