![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a db in which the client enters a "Unique Block Number" which is allocated by the client. Currently it is a text field. which is set to "NO Duplicates". However, there are ocassions when the client wants to use a secondary number e.g. "/2" . As an example - 339 339/2 626 626/1 626/2 626/3 507/1 507/2 507 etc etc From my limited understanding, if the field is set as TEXT then you lose the ability to ASC and DES in numerical order etc. If the "/" is used in a Number field then it will not be accepted. Does anyone have any ideas on how to set this up. There is so much data currently in use that there is little chance of convinving them to change to something else. TIA - Ray |
#3
| |||
| |||
|
|
I have a db in which the client enters a "Unique Block Number" which is allocated by the client. Currently it is a text field. which is set to "NO Duplicates". However, there are ocassions when the client wants to use a secondary number e.g. "/2" . As an example - 339 339/2 626 626/1 626/2 626/3 507/1 507/2 507 etc etc |
#4
| |||
| |||
|
#5
| |||
| |||
|
|
For sorting, just make an exprssion in the query builder like: mysort:sortBlock([blockNumber]) Now, add the follwing function in a public module: Public Function sortBlock(vData As Variant) As Variant If IsNull(vData) = True Then Exit Function sortBlock = Split(vData, "/")(0) sortBlock = Format(sortBlock, "00000") End Function -- |
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |