Results 1 to 2 of 2
  1. #1
    rjackson is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2016
    Posts
    2

    DLookup on a DateTime field

    I have a simple table called Table1 with three fields - ID: AutoNumber, Field1: Text, and Field2: DateTime.
    Query1 has two added fields - TextField and DTField.

    TextField: DLookUp("[Field1]","Table1","[ID]=" & [ID]+1) This works just fine.

    DTField: DLookUp("[Field2]","Table1","[ID]=" & [ID]+1) Gives an #Error



    I have searched but I've only found #date# or #time# in the criteria parameter.
    I want it to function like the TextField - return the value ( which is a Date/Time ) from Field2 of the next record to DTField.
    Click image for larger version. 

Name:	Table1.JPG 
Views:	15 
Size:	65.1 KB 
ID:	25539 Click image for larger version. 

Name:	Field1 and Field 2 Test.JPG 
Views:	15 
Size:	78.6 KB 
ID:	25540

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    you really shouldnt use Dlookup in a query. The query is the Dlookup.
    This will bog down the query significantly.

    Is this an example, or what do you really want to do?

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

Similar Threads

  1. Replies: 1
    Last Post: 08-15-2016, 10:29 PM
  2. Setting a DateTime field back to "empty"
    By ts_hunter in forum Forms
    Replies: 12
    Last Post: 08-14-2015, 10:46 AM
  3. Replies: 2
    Last Post: 07-20-2015, 07:51 PM
  4. Conditional Formatting on datetime field
    By Delta729 in forum Access
    Replies: 3
    Last Post: 05-06-2015, 03:37 PM
  5. Help with datetime field in subform
    By Delta729 in forum Access
    Replies: 3
    Last Post: 04-07-2015, 04:47 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