This seemed to work for me. Provided the drawing number format will be
"xxx-xx-xxxx" or "xxx-xx-xxxx-x" or "xxx-xx-xxxx-xx"
try this:
add this function:
Code:
Public Function DwgFormat(pDwg As String) As String
Dim LenDwg As Integer
LenDwg = 14 - Len(Trim(pDwg))
Select Case LenDwg
Case 0
DwgFormat = pDwg
Case 1
DwgFormat = Left(pDwg, 12) & "0" & Right(pDwg, 1)
Case 3
DwgFormat = pDwg & "-00"
End Select
End Function
This is the query I usedto test:
Code:
SELECT Table1.Drawing, DwgFormat([Drawing]) AS Expr1
FROM Table1
ORDER BY DwgFormat([Drawing]);