DMax with more criterias

omaggi

Registered User.
Local time
Today, 12:33
Joined
Oct 19, 2009
Messages
43
Hi Everybody.
I'm trying to build a Dmax function that include more criteria. But I have some problems.

Here I post the 2 DMax function:

DMax("age", "data", "[id_name] = " & Me.ccName)
DMax("age", "data", "[id_address] = " & Me.ccAddress)

I need that the 2 are together so I will receive as output the record the the max age with these 2 criterias...

Thanks for any help.

Greetings.
 
If id_name and id_address are text fields:
Code:
DMax("age", "data", "[id_name] = " & Chr(34) & Me.ccName & Chr(34) & " And [id_address] = " & Chr(34) &  Me.ccAddress & Chr(34))
 
Thanks, I tried but doesnt work...

If I write the 2 functions DMax separate, works good but I need absolutly to concat the 2 functions together...If not I don't have the right value in output...

Any other suggestions?
 
Well, the code I showed is correct. I looked back at it just in case. Can you post what code you are trying to use (after concatenating)?
 
I use the code you posted...but I have an error about type of data...
 
Oh, and are these controls TEXT boxes or COMBO boxes?

Me.ccName
Me.ccAddress
 
Ah, so go ahead and see if this works without the Chr(34).

DMax("age", "data", "[id_name] = " & Me.ccName & " And [id_address] = " & Me.ccAddress)
 
Thanks now it works!!!

Thank you so much.

Greetings.
 

Users who are viewing this thread

Back
Top Bottom