View Full Version : Dmax criteria not working but should be


arage
05-17-2001, 11:52 AM
I defined a long integer field in my table & then set a globalField in a standard module as Long also. Then I set up a Dmax function using the two fields but I get an error that the criter has mismatched data types. Can someone recommend why this is?

x = DMax("eventnumber", "testqry", "regionaldirectorcode= '" & glblDirCode & "'")

regionaldirectorcode is a long integer in the table definition
glblDirCode is a Long in the standard module

“error is 3464 The criteria expression in a Find method is attempting to compare a field with a value whose data type does not match the field’s data type.”

Pat Hartman
05-18-2001, 06:17 AM
You need to remove the quotes from around glbDirCode. Quotes are only used to surround string variables.

x = DMax("eventnumber", "testqry", "regionaldirectorcode= " & glblDirCode)