Mar 21, 2007 #1 RandDUser Technical User Feb 24, 2005 65 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!
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!
Mar 21, 2007 1 #2 AlexCuse Programmer Apr 13, 2006 5,416 US YOur criteria needs to be Code: "SomeColumn = " & me.textbox1.Value Hope this helps, Alex Ignorance of certain subjects is a great part of wisdom Upvote 0 Downvote
YOur criteria needs to be Code: "SomeColumn = " & me.textbox1.Value Hope this helps, Alex Ignorance of certain subjects is a great part of wisdom
Mar 21, 2007 Thread starter #3 RandDUser Technical User Feb 24, 2005 65 US 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. Upvote 0 Downvote
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.
Mar 21, 2007 #4 AlexCuse Programmer Apr 13, 2006 5,416 US 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 Upvote 0 Downvote
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
Mar 21, 2007 Thread starter #5 RandDUser Technical User Feb 24, 2005 65 US That did the trick, thanks! Upvote 0 Downvote