DMax

S

sturner333

I am trying to do a DMax with 2 criteria. When I put in a constant for the
first criteria ('7000'), it works correctly. When I try to use a form object
value ( 'Me.Market' ) I either don't get anything or an error depending on
my syntax. Any help!
Thanks

Current = DMax("[projectNumber]", "sheet2", "[market] = '7000' and left
_([projectNumber],1) <> 'T'")

Current = DMax("[projectNumber]", "sheet2", "[market] = 'Me.Market' and
left _([projectNumber],1) <> 'T'")
 
S

sturner333

I found answer. Thanks

Current = DMax("[projectNumber]", "sheet2", "[market] = '" & Me.Market & "'
and left([projectNumber],1) <> 'T'")
 
S

sturner333

Thanks very much!

Marshall Barton said:
sturner333 said:
I am trying to do a DMax with 2 criteria. When I put in a constant for the
first criteria ('7000'), it works correctly. When I try to use a form object
value ( 'Me.Market' ) I either don't get anything or an error depending on
my syntax. Any help!
Thanks

Current = DMax("[projectNumber]", "sheet2", "[market] = '7000' and left
_([projectNumber],1) <> 'T'")

Current = DMax("[projectNumber]", "sheet2", "[market] = 'Me.Market' and
left _([projectNumber],1) <> 'T'")


You need to put the value in the where condition, not a
reference:

Current = DMax("projectNumber", "sheet2", "[market] = '" _
& Me.Market & "' And Left (projectNumber,1) <> 'T'")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top