Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DMAX function where clause 1

Status
Not open for further replies.

RandDUser

Technical User
Feb 24, 2005
65
0
0
US
I have a DMAX function where I need 'XX' = me.textbox1.value:

DMax("[Year]", "tbl_MAIN", "XX")

I tried: DMax("[Year]", "tbl_MAIN", me.textbox1.value), but produces a run time error. I'm sure it's something simple, but I can't figure it out.

Thank you!
 
YOur criteria needs to be

Code:
"SomeColumn = " & me.textbox1.Value

Hope this helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
OK, I tried the above:

DMax("[Year]", "tbl_MAIN", "Quantity = " & me.textbox1.Value)

And I got a runtime error 2001. Not sure if I have the syntax right.
 
Ah, it's quantity. Number needs to = number. Try this:

Code:
DMax("[Year]", "tbl_MAIN", "Quantity = " & val(me.textbox1.Value))

Hope it helps,

Alex

Ignorance of certain subjects is a great part of wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top