Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2004
    Posts
    23

    Unanswered: Form Calculations

    I'm very new to Access and as such I'm having great difficulties with this.

    I'm having a problem with the Children attendance form, since the primary key is an autonumber, so when I'm trying to input attendance info(absent/present, children name etc) it tell me that no duplicates are allowed, also I can't seem to figure out an easy way to input the attendance for each child daily.

    The employee attendance form I would like a calculation done for total hours worked for a particular day after the Time in & time out hours are entered.

    Also if there is a statutory deduction like income tax & National Insurance from total wages...where can I put in these fixed values in percentage?


    Many thanks.
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    In terms of your employee total hours worked, try the following in the Control Source of your total hours worked textbox:

    =Format([TIME IN]-1-[TIME OUT],"Short Time")

  3. #3
    Join Date
    Nov 2004
    Posts
    23
    Thanks alot!!!!

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by Latoya
    Thanks alot!!!!
    Hi Latoya,

    I looked at your database and checked out the "frmAttendance". I noticed that when I tried to select Yes/No from the Attended ComboBox that it defaults to "NO". However, when you click to arrow to drop the box down to make a selection, there is no "YES/NO" instead it has "Present" and "Absent" and you placed that in the ControlSource for that object. In the Table you have Yes/No. In your PropertySheet for that field go to the DataTab and then RowSource and put: "Yes";"No" That will take care of that problem for you. I have yet to figure out what is the problem with your command buttons on your forms but will check them out again when I reload Access. I hung and closed on me.

    anyhow, that is one thing you can do to tweak your program.

    have a nice one,
    BUD

  5. #5
    Join Date
    Nov 2004
    Posts
    23
    Thanks Bud. I changed the text box to "yes", "No". But I still have a problem with the attendance form its not allowing me to enter the child name more than once and I need to do that if I'm going to enter the attendance daily. Also the same goes for Employee attendance.

  6. #6
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    must the primarykey be a autonumber ?, if this is only to get the date in order, well set primarykey to the date field.

    or when you want the table indexed on childID then get rid of the autonumber and make it numberfield with duplicates allowed, in which case you can keep the primarykey on the same field.

  7. #7
    Join Date
    Nov 2004
    Posts
    23
    I tried to do that but when I select Primary key....the index field is automatically changing back to "Yes(No Duplicates)" even though I set it to "Yes(Duplicates ok). Am I doing something wrong??

  8. #8
    Join Date
    Sep 2004
    Location
    Charlotte, NC
    Posts
    164
    No you aren't doing anything wrong. You can't have a Primary Key in Access unless it is Indexed with No Duplicates. Also the suggestion of the date as a primary key won't work because you will have the same date multiple times. Here is a solution:

    Open your table TblChildrenAttendance in Design Mode. From the View section of the Menu Bar, select Indexes. Delete the indexes listed and then in the Index Name field, enter ChildDate and in the Field Name select ChildID and select Ascending for the Sort Order. On the next row, leave the Index Name empty and then in the Field Name select Date and select Ascending for the Sort Order. Click in the cell that says ChildDate and set the Primary Value to Yes and Unique should set to Yes. This will allow you to enter additional records for a child as long as there isn't already one for that child on that same date, which should not be a possibility since this is just an Attend Yes/No tracker.

    TD
    Attached Thumbnails Attached Thumbnails Index.jpg  
    Last edited by buckeye_td; 11-18-04 at 14:12. Reason: Attached snapshot of Index

  9. #9
    Join Date
    Nov 2004
    Posts
    23

    Thumbs up

    Thanks....this worked fine.

  10. #10
    Join Date
    Nov 2004
    Posts
    23
    Do I have to do something similar for the employees attendance form??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •