Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228

    No results for specific value.


    TimesheetTest.zip

    Ive attached a sample database. I have removed most of the data but it still shows the problem.

    If you open the TSEntries form (you can get to this from the menu form by clicking Payroll).

    This form will show a sum of hours worked per person for that week.

    There is a button next to it which, when clicked will display a breakdown of those hours.

    It works fine except for anything with a date of 07/10/2018. Ive tried remaking every form, changing dates... I've even remade the whole database....

    What am I missing here? If anyone could take a look i would appreciate it.

    Andy.

  2. #2
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    You need to format your date - Access is chnaging your UK date to US format.

    Change this line to this;
    Code:
    
    DoCmd.OpenForm "TSEntries1", , , "[TS_Week_Ending]=" & "#" & Format([TSWeek_Ending], "mm/dd/yyyy") & "#"
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Well I never. That simple. I spent about two days trying to fix it before I "broke" and came here.

    Thanks a lot.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Allen Browne has a function for that.

    See http://www.allenbrowne.com/ser-30.html

    Look for the "Dates in Strings" section

  5. #5
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Something is wrong with my formatting here, I dont often use functions to be honest.

    It has the error, "expected end of statement" on the SQLDate part.

    Code:
    DoCmd.OpenForm "Payroll_Breakdown", , , "[TS_Week_Ending]=" SQLDate [TSWeek_Ending]
    Ill keep changing things around and looking but can you see anything obvious?

  6. #6
    Minty is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,157
    It should be something like

    Code:
    & SQLDate(Me.TSWeek_Ending)
    Note the brackets and the & to concatenate the string

    Assuming the controls on your form is called TSWeek_Ending

    Helpful Hint of the day : In the immediate VBA editor window type the following

    ?SQLDate(DAte())

    And hit return -
    ? will print the results of a typed expression.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  7. #7
    Join Date
    Jun 2015
    Location
    Wales. Land of the sheep.
    Posts
    1,228
    Brilliant. Also that is a good hint. Works a treat!

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

Similar Threads

  1. Hide specific query results by subtable
    By Muffel2k in forum Queries
    Replies: 4
    Last Post: 10-28-2017, 01:35 AM
  2. Replies: 1
    Last Post: 02-23-2016, 08:36 PM
  3. Replies: 4
    Last Post: 12-17-2013, 08:31 AM
  4. Replies: 5
    Last Post: 03-01-2013, 04:20 PM
  5. Replies: 1
    Last Post: 09-24-2012, 07:09 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