Dim tPGM as integer (or long) . It has to be numeric.
You could use CInt(tPGM) also.
Yes, make it a number type NOT text.
Possibly make it the same as nRace ?
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
seems to me that your data is not normalised and with regards your datatype not changed error it will be because there is some text in one of more of the records
Yes , some data could be 1a 1b 2a 2b 3x along with the normal numbers .....so your telling me it cant be done?
number sort differently to text so within the context of a column of data only by changing the values soso your telling me it cant be done?
1>01
10>10
1a>01a
etc
and if the numbers can go to 3 digits then you would need
1>001
10>010
1a>001a
etc
or you need an additional column with the formula
=val([tPGM])
to sort on.
number sort differently to text so within the context of a column of data only by changing the values so
1>01
10>10
1a>01a
etc
and if the numbers can go to 3 digits then you would need
1>001
10>010
1a>001a
etc
or you need an additional column with the formula
=val([tPGM])
to sort on.
thank you for your time......
If the maximum length is 2, you could try:
Code:SELECT tPGM FROM T1 ORDER BY IIf(Len([tPGM])=1 And IsNumeric([tpgm]),"0" & [tPGM],IIf(Len([tPGM])=2 And Not IsNumeric(Mid([tPGM],2,1)),"0" & [tPGM],[tPGM]));