Results 1 to 2 of 2
  1. #1
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317

    Can't get VBA to pick up duplicate dates

    Folks



    I can't get VBA to pick up duplicate dates. Here's my code (used within the Before Update event of the relevant field):

    Code:
    DCount("ReviewDate", "ReviewDateTable", "ReviewDate = #" & Me!ReviewDate.Value & "#")
    The table is called 'ReviewDateTable' and the relevant field is called 'ReviewDate', as is the relevant field on the form. The field in the table and the field on the form both have the format 'dd/mm/yy'.

    What can I be doing wrong?

    Thanks

    Remster

  2. #2
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    317
    As is so often the case, I hit on the solution shortly after posting:

    Code:
    DCount("ReviewDate", "ReviewDateTable", "ReviewDate = #" & Format(Me!ReviewDate.Value, "mm/dd/yyyy") & "#")

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

Similar Threads

  1. Getting form to recognize duplicate dates
    By Remster in forum Programming
    Replies: 3
    Last Post: 09-21-2011, 03:26 AM
  2. program that pick a random winner
    By georges.choueiry in forum Access
    Replies: 4
    Last Post: 09-29-2010, 01:05 AM
  3. Replies: 8
    Last Post: 09-22-2010, 12:30 PM
  4. How to pick the n-th row from a query
    By Johnny C in forum Queries
    Replies: 2
    Last Post: 07-27-2010, 05:14 AM
  5. Eliminate redundant data from Pick Box?
    By jsbdiver in forum Forms
    Replies: 5
    Last Post: 06-14-2010, 04:04 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