Page 2 of 2 FirstFirst 12
Results 16 to 27 of 27
  1. #16
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,987

    I really did wonder whether this thread was also an April Fool like the Office 366 item!

    Whilst I agree the built in date picker is dire, why anyone would prefer to type in a date rather than use a decent calendar form is beyond me.
    Even so how often will they actually type an invalid but confusable date like 29/02/2019?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  2. #17
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    Typing? Because users are speed typers using keyboard to navigate forms, they don’t really use the mouse for data entry. Also consider 31/4 etc or a real typo 41/4/19 gets converted to 19/4/41

  3. #18
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,987
    However if their speed typing is causing lots of mistakes, perhaps not such a good idea.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  4. #19
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    They don’t make many mistakes so far as I know, but the client wants the additional protection. A wrong date can have a big impact on a number of reports

  5. #20
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,737
    Is there anything common to these dates (eg always earlier/later than today etc)?

    How would format validate 03/02/2019 from 02/03/2019?
    Seems day and month below or equal to 12 would require knowledge of the "transaction/entry" data in context.

    A wrong date can have a big impact on a number of reports
    depending on criticality then perhaps a custom calendar (as Colin hinted) or another format YYYY-MM-DD (ISO 8601).
    Last edited by orange; 04-03-2019 at 08:35 AM. Reason: typo

  6. #21
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    As already stated a custom calendar is not an option. Some date verification can be applied but client isn’t keen. They fully accept a user might mistakenly enter a wrong but valid uk date. They simply don’t want access to change an invalid uk date into a valid us one

  7. #22
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Hi Ajax,
    Have a look at the attachment.
    This is an approach with a class module that keeps your validation code for each date control in the form. As you want, the cursor remains in the control after the critical message, and in addition, the advantage of this approach is that you dont'n have to add any code in the events of text boxes in form's code module. You have only to mark each date TextBox as "UKDate" (or whatever) in their Tag property.
    Pay attention in the form's events code (Load-Unload) that creates an istance of the class for each control that have the "UKDate" word in its Tag property.

    I hope it helps!
    Attached Files Attached Files

  8. #23
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,987
    Just tested this.
    Whilst it correctly blocked 29/02/2019, it didn't accept the last valid date of the month e.g. 28/02/2019 was also blocked
    I've changed all instances of < to <= in the IsUKDate function and I believe it now works as you intended
    Attached Files Attached Files
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #24
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Hi Colin!

    Yes, indeed, it was a bug, but I consciously left the function as it was because it was not that the issue.

    Ajax is responsible for these issues. :-)

  10. #25
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    thanks all - I'll give it a try - note still a bug for 30 day months, but fixed that!

  11. #26
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,987
    Ah yes. Didn't notice that.
    I think its 'disgraceful' that you have not dealt with 29/02/2100 etc.
    Built in code obsolescence!
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  12. #27
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,445
    don't think I'll be around to worry about it

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

Similar Threads

  1. Replies: 9
    Last Post: 11-22-2017, 03:59 PM
  2. The value you entered isn't valid for this field
    By paologucci in forum Access
    Replies: 2
    Last Post: 03-21-2016, 01:40 AM
  3. Replies: 1
    Last Post: 11-29-2014, 12:23 PM
  4. Value you entered isn't valid for this field
    By rhubarb in forum Programming
    Replies: 12
    Last Post: 11-03-2011, 07:26 AM
  5. Replies: 4
    Last Post: 08-25-2011, 07:57 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