Full Version: Decimal Fields
UtterAccess Discussion Forums > Microsoft® Access > Access Tables + Relationships
glb
I have a decimal field that I'm trying to query. If I set up the criteria with a numeric value it queries just fine.If I set it up for an answer [Enter Criteria] it finds nothing. All other non-decimal fields work fine. What to do?
BenPurser
Two thoughts, the first being a SERIOUS SWAG

try CDbl([Enter Criteria])

though, frankly, I doubt this will work....

Next, can you have your user enter the criteria in an unbound text box on a form, and have the criteria be:

forms!formname.textboxname
where formname and textboxname are replaced with the real form and control names??

HTH
Ben
glb
The serious SWAG worked! Why does that work? Thanks
BenPurser
Because you force access to treat the input as a number--converting it to a double type. if you enter a criteria directly, it takes on the type of the field, but if you use a prompt, it gets treated as text....another fine 'feature' of access..

Ben
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.