Solved Expression Builder Latest Date in Forms (1 Viewer)

ardy

Registered User.
Local time
Today, 09:47
Joined
Sep 24, 2012
Messages
98
Hello All,
I am trying to use the expression builder to get the latest date in a table in a form inside an unbound text box utilizing DLookUp. Have tried a bunch of different syntax options of the same formula.o_O None are working what am I doing wrong..... Any help is appreciated....

Code:
=DLookUp([Sample Date],"DDW_Import","[Smaple Date]=#" & Format(DMax("[Sample Date]","DDW_Import"),"mm/dd/yyyy") & "#")
 
It looks like youre looking it up twice.
can you just use: DMax("[Sample Date]","DDW_Import")
 
Just use DMax()
 
It gives me #Name? Error.....
Code:
DMax("[Sample Date]","DDW_Import")
 
So either the field or table name is spelt incorrectly
 
As far As I can see/tell they are correct....
1700262208955.png

1700262219048.png
 
Have you got an = in front of the dmax? As you have in post #1
 
Hello All,
I am trying to use the expression builder to get the latest date in a table in a form inside an unbound text box utilizing DLookUp. Have tried a bunch of different syntax options of the same formula.o_O None are working what am I doing wrong..... Any help is appreciated....

Code:
=DLookUp([Sample Date],"DDW_Import","[Smaple Date]=#" & Format(DMax("[Sample Date]","DDW_Import"),"mm/dd/yyyy") & "#")
[Sample date] is misspelled in the second instance
 
Looks like you're trying to fetch the latest date from a table into an unbound text box using the expression builder. Sometimes, getting the syntax right can be tricky. Double-check if the table name and field are spelled correctly in your DLookUp formula. Maybe that's where things are going a bit wonky
 
Thank you all for responding...... I Do Appreciate it.

@CJ_London
You are right I was missing the "=". How I miss that is a dilemma, but you look at something for hours the simplest things are missing. So " =DMax("[Sample Date]","DDW_Import") works and I can get the show on the road. thank you for pointing that out.

@AccessBlaster
Yes, you are right I misspelled the Sample Date. Correct it but it still didn't work. That is a dilemma for me on a personal note. I most likely will play around with this and resolve it one of these days. for now the above gets my show on the road.

@Oviziest
I also think that is the syntax issue, Access gets finicky with that. As I said I will see if I can get it right by trying different combinations when time allows, for now, the simple expression(above) works.

@Gasman
No, it's not the caption. I use them sometimes in different projects, but didn't use them in this one.

All and all I want to thank all of you for the responses.
 

Users who are viewing this thread

Back
Top Bottom