Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17
  1. #16
    karanvemuri is offline Advanced Beginner
    Windows Vista Access 2010 64bit
    Join Date
    Sep 2011
    Posts
    56
    the search is running fine,however a new record is being created in the DB by the search criteria which i give in the fields in the original form.

    below is the code,

    strCriteria = "[Agent Name] = '" & Me.[Agent Name] & "' "
    strCriteria = strCriteria & "AND [DetailDate] = #" & [DetailDate] - 1 & "#"

  2. #17
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    I don't think that [DetailDate] will ever be equal to [DetailDate] - 1

    Try this:

    strCriteria = "[Agent Name] = '" & Me.[Agent Name] & "' "
    strCriteria = strCriteria & "AND format([DetailDate],'yyyymmdd') = format(#" & Date() - 1 & "#,'yyyymmdd')"

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

Similar Threads

  1. VBA Issue
    By MikeDBMan in forum Access
    Replies: 9
    Last Post: 08-02-2011, 03:59 PM
  2. Date/Time Search Midnight Issue
    By Coffee in forum Queries
    Replies: 5
    Last Post: 07-26-2011, 01:54 AM
  3. Issue with Do
    By Petefured in forum Programming
    Replies: 1
    Last Post: 05-25-2011, 09:27 AM
  4. Replies: 4
    Last Post: 03-17-2011, 06:17 AM
  5. Replies: 2
    Last Post: 08-31-2010, 08:57 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