DLookUp With Dates On A Report

Anonymous
2025-06-23T12:49:44+00:00

In my same Executive Summary Report, I want to use the DLookup function to call for the following information onto the report:
~ Date and the format is a Medium Date
~ CompanyName
~ Address 1
~ Address 2
~ URL
~ Email
~ Tel
Thank you

Microsoft 365 and Office | Access | For business | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

12 answers

Sort by: Most helpful
  1. Anonymous
    2025-06-23T15:43:05+00:00

    PS: Regarding George’s point that some of the values might contain non-zero time of day elements I would recommend that you firstly change the values so that the time of day element is zero in every case with the following UPDATE query:

    UPDATE [Master Table]

    SET Date_Created = INT(Date_Created)

    WHERE Date_Created IS NOT NULL;

    Then set the Date_Created column's ValidationRule property to prevent further invalid values being entered:

    Int([Date_Created]) Or Is Null

    0 comments No comments
  2. Anonymous
    2025-06-23T16:04:01+00:00

    Please, I am now getting used to the Access Database.
    Pardon me, and I am considering all your corrections.

    Please, teach me all that I have to do.

    For those new fields, I added them to the Master Table today.

    Thank you

    0 comments No comments
  3. ScottGem 68,775 Reputation points Volunteer Moderator
    2025-06-23T16:52:47+00:00

    Please, teach me all that I have to do.

    For those new fields, I added them to the Master Table today.

    Thank you

    We are happy to help you. But you are not heeding some of our advice.

    Those fields should NOT have been added to the Master Table. There should be a separate Customer's table with a CustomerID foreign key in the Master Table. What you have means you have to repeat the Customer info for each Incident.

    The key to an efficient database is a proper table structure. Before you start entering data or designing reports (or forms for that matter), you need to get your table structure normalized properly. You are setting yourself up for future problems if you don't.

    Again, I suggest you give us more info about the what the application does and what data you are capturing so we can advise a proper table structure.

    0 comments No comments
  4. DBG 11,531 Reputation points Volunteer Moderator
    2025-06-23T17:10:12+00:00

    but it is not working. Still figuring it out ...

    However, other fields such as: Document Version and Classification had worked ...

    Thank you "> Please, below is the code for the Date:
    =DLookUp("[Date_Created]","Master Data","[Date_Created] = #" & Format([Datetxt],"dd-mmm-yyyy") & "#")

    but it is not working. Still figuring it out ...

    However, other fields such as: Document Version and Classification had worked ...

    Thank you

    On a slightly different topic: I always find it interesting when DLookup() is used in this manner. If you're trying to determine if a record exists, I prefer to use DCount() instead. Typically, DLookup() is used to "look up" a value that you may not know yet. For example, you can use DLookup() to look for a client's first name if you only knew their last name [DLookup("FirstName","Clients","LastName='Bond'"), or vice versa, look up their last name when you only have the first name. You wouldn't normally look up a client's name when you already know what it is: DLookup("ClientName","Clients","ClientName='James Bond'"); instead, you can use DCount("*","Clients","ClientName='James Bond'") to check if you already have a client with that name. Hope that makes sense...

    0 comments No comments
  5. Anonymous
    2025-06-23T17:38:49+00:00

    Thank you, Sir.

    0 comments No comments