Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Where are you - is date regional system setting an issue?

    Are users inputting date as mm/dd/yyyy? Will strCondition1 always be a single date value as criteria?



    Don't need the rdate variable for code as structured.
    Try:
    strCondition1 = InputBox("Enter date")

    Problem with prompts is harder to validate user input.
    While Not IsDate(strCondition1)
    strCondition1 = InputBox("Enter date")
    Wend

    Then in the query:
    WHERE ((Accounts.Date)=#" & strCondition1 & "#)

    I did some tests of IsDate function:
    IsDate("1/1/2012") = True
    IsDate(#1/1/2012#) = True
    IsDate("#" & "1/1/2012" & "#") = False
    IsDate(1/1/2012) = False
    IsDate(#"1/1/2012"#) = error message
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    bidbud68 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    19
    Hi yes the regional settings are an issue as we are in South Africa but iwill enter mm/dd/yyyy

    The code above does work perfectly though thank you.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need help w/ docmd.openreport
    By jwill in forum Reports
    Replies: 3
    Last Post: 06-04-2012, 09:49 PM
  2. OpenReport WHERE Condition Not Working
    By altemir in forum Reports
    Replies: 1
    Last Post: 02-17-2012, 09:58 AM
  3. Replies: 3
    Last Post: 11-19-2010, 01:48 PM
  4. DoCmd OpenReport ... where condition with a Like
    By Grooz13 in forum Programming
    Replies: 4
    Last Post: 08-31-2010, 09:04 AM
  5. Can docmd.openreport print X copies on Y printer?
    By Coolpapabell in forum Reports
    Replies: 1
    Last Post: 09-02-2009, 08:35 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