Rebooted, Compact/Repaired, copied objects over into fresh database, rebooted again, moved to an XP machine, everything failed — what am I doing wrong? It must be something simple!
(Edits — forgot to add that this database was built on a Win 2k machine, but I also moved it to an XP machine — because there was some date issue in Access 2k which I seem to remember bit me once in Access XP on a 2k machine, although this does not involve a date …)
Here’s the problem: I’m trying to prompt the user with the max tracking number + 1 as a suggestion for a new record. The “TrackNo” is in the form: “12-2003.”
To test this out, I had one TrackNo that was null, one “abc,” one “174,” and one “11-204,” as well as several in the correct format.
Step1Qry:
SELECT TrackNo as GoodTracker
FROM MyDB
WHERE TrackNo Is Not Null; — this excludes the one null
Step2Qry:
SELECT Val([GoodTracker]) AS NumTrkr
FROM Step1Qry; — this yields 0 for the “abc”
Step3Qry:
SELECT NumTrkr ( Edited: Removed the “SB_Year” from original forum msg — had earlier pared everything out except the very most basic fields required.)
FROM Step2Qry
WHERE NumTrkr > 0; — attempting to exclude the “0” record
Step3Qry fails with DataType Mismatch on Criteria expression.
* I did a “vartype” function on the NumTrkr, and it is a double. Just to see if it would make a difference, I converted the NumTrkr to a CLng, then did the last comparison — still broke!
Note: This formerly was just a number, indexed / no dups, without the “- year” section. The users wanted to restart the number at each new year, so I changed it to the current format and made it a string. I thought that would take a little extra work on the queries, but really offer no problem.
thx
Pat