DMax on Text Field

Q

Question Boy

I have a little problem that hopefully someone can help me with.

I have a table that currently I cannot make changes to. I will at my next
maintenance window, but I need a temporary solution for now. I have a text
field that actually houses whole numbers (should be sequential 1,2,3,4,.. for
each project in the db as req'd). Anyways, I need to find out the last
number enter to determine the next number that should be used. I used DMax
which works as long as there a 9 or less entries. Above 9, ie 10, it always
return 9 as the Max value and ignore the fact that 10 exists. Is there a way
to tell the DMax Function to interpret the text field as a numerical field?
Below is my code

DMax("[ChangeNum]", "tbl_Changes", "[Projects]='" & Left(Me.Proj,
Len(Me.Proj) - 1) & "'")

Thank you,

QB
 
D

Douglas J. Steele

DMax("CLng([ChangeNum])", "tbl_Changes", "[Projects]='" & Left(Me.Proj,
Len(Me.Proj) - 1) & "'")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top