Results 1 to 2 of 2
  1. #1
    Brian62 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    147

    How to show current vacation time

    I have a form I am trying to show the vacation time used.

    The table name is Timeoff, columns are: "Code" (shows Vacation and illness) and "Timeused" (Hrs used for vacation, example 8 hrs for the day)

    I would like to add the "Timeused" (8 hrs) that has the "code" (Vacation) to show in the unbound text box.

    =Sum(IIf([code])=[Vacation],[timeused],Null))

    This is what I came up with, but I can't get it to work, gives me an #error. Any suggestions? Thx!



    I would really like to add the total hours the employee gets bi-weekly and subtract from the timeused that was used for vacation to give what they have left.

  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    I'd sum each field separately and then do the IIF instead of trying to sum and do an IIF in the same statement. Using Sum( and IIF( in the same statement is often problematic.

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

Similar Threads

  1. Show current Time
    By dada in forum Programming
    Replies: 5
    Last Post: 05-03-2012, 04:32 AM
  2. Aslways show Current Date even in Old records
    By farhanahmed in forum Programming
    Replies: 3
    Last Post: 04-03-2011, 12:56 PM
  3. Show only current record in report from form/subform
    By stelioshania in forum Reports
    Replies: 0
    Last Post: 03-02-2011, 02:19 PM
  4. Replies: 12
    Last Post: 02-22-2011, 03:39 PM
  5. VB coding to show current date n time in access form
    By cwwaicw311 in forum Programming
    Replies: 6
    Last Post: 02-10-2010, 09:53 PM

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