Results 1 to 5 of 5
  1. #1
    davidelsbury is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    4

    Access 2003 Template Problem - Time and Billing

    Hi there


    I've been trying to teach myself how to make Access 2003 code up a database
    for time and billing - and the best template that I've found so far has been
    the one that Microsoft ship with Access 2003, "Time and Billing". I have run
    into the problem that the pictures below show, where when one comes to try
    and generate an invoice, the fields display a "#Name?" error. As far as I can
    tell, all the fields are populated correctly and there are no null values (I
    even went so far as to create some zero dollar expenses to see if that fixed
    the problem).

    I would appreciate if someone could take a look at my database for me and
    tell me what I am doing wrong. I did read another post on here from about 5
    years ago where the advice given was similar, but for generating a report,
    not using the functions I am using. I think it's to do with how Access is
    using the "IIf" function, but that's as far as I have got.

    Thanks in advance for any assistance or advice.

    Cheers
    David

    Attachments:
    (Client Window)
    (Print Preview)
    (Print Window)
    http://www.easy-share.com/1916933068/DavidElsbury.mdb (Database)

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Create this query in your database and name it Qry_CurrentInvoice:

    Code:
    SELECT Sum([Time Card Hours].BillableHours) AS BilledHours, Sum([billablehours]*[billingrate]) AS BillAmt
    FROM [Time Card Hours]
    GROUP BY [Time Card Hours].DateWorked, [Time Card Hours].ProjectID
    HAVING ((([Time Card Hours].DateWorked)>=[forms]![Print Invoice]![Begin Date] And ([Time Card Hours].DateWorked)<=[forms]![Print Invoice]![End Date]) AND (([Time Card Hours].ProjectID)=[forms]![Print Invoice]![Project ID]));
    In the ON EXIT property of your start date and end date text boxes change your code to:

    Code:
        Me![Print Invoice Time Subform].Requery
        Me![Print Invoice Expenses Subform].Requery
        If Not IsNull(Me![begin date]) And Not IsNull(Me![end date]) Then
            Me![total hours] = DLookup("[BilledHours]", "Qry_CurrentInVoice")
            Me![total hourly billings] = DLookup("[BillAmt]", "Qry_CurrentInVoice")
        End If
    it's a bit brutish but it's quick and easy to make work, you'd do something similar for your expenses and likely on the report as well.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I downloaded your example MDB. I couldn't replicate your errors. Everything had values- no ERROR indicators.

    Sometimes after making changes you have to close out of access then open it back up to see the changes.

  4. #4
    davidelsbury is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    4
    Quote Originally Posted by ssanfu View Post
    I downloaded your example MDB. I couldn't replicate your errors. Everything had values- no ERROR indicators.

    Sometimes after making changes you have to close out of access then open it back up to see the changes.
    Thanks to both of you for the replies. Ssanfu, I wonder if the reason you saw no errors is because you opened it in Access 2000? The title bar of my database says that it is "Access 2000 Format". I will see if I can get a copy of Access 2000 to try, it just seems a bit strange that Microsoft would send out an example database with errors in it.

    Cheers
    David

  5. #5
    davidelsbury is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    4
    Just posting a followup- thank you all for your help. I have got a copy of Access 2000 and the database works fine. No idea why there is a difference between 2000, and 2003 but it's a good enough work around for me.

    Cheers
    David

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

Similar Threads

  1. Access 2003 subform linking problem
    By RANCHLAW56 in forum Access
    Replies: 1
    Last Post: 12-26-2010, 05:35 PM
  2. MS Access Template Problem
    By Zan in forum Access
    Replies: 8
    Last Post: 12-01-2010, 10:16 PM
  3. Time picker for Access 2003
    By Thiyagu in forum Access
    Replies: 1
    Last Post: 03-24-2010, 06:36 AM
  4. Replies: 2
    Last Post: 11-10-2009, 02:49 PM
  5. [Access 2003] Displaying 24 Hour Time
    By Trainman in forum Access
    Replies: 4
    Last Post: 03-18-2009, 06:34 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