10-19-2022, 07:24 AM
HL = DataBaseValue
If HL < Low Then Low = (_Round(HL * 100000)) / 100000
If HL > High Then High = (_Round(HL * 100000)) / 100000
And *before* your DO-LOOP where you check those values, initialize the high/low variables.
LOW = *max variable value*
HIGH = *min variable value*
So for an unsigned byte, LOW = 255: HIGH = 0. For an unsigned integer, LOW = 65535: HIGH = 0.
This way *any* database value will be less than LOW, setting it to the database limit, while the same is true with the HIGH.
If HL < Low Then Low = (_Round(HL * 100000)) / 100000
If HL > High Then High = (_Round(HL * 100000)) / 100000
And *before* your DO-LOOP where you check those values, initialize the high/low variables.
LOW = *max variable value*
HIGH = *min variable value*
So for an unsigned byte, LOW = 255: HIGH = 0. For an unsigned integer, LOW = 65535: HIGH = 0.
This way *any* database value will be less than LOW, setting it to the database limit, while the same is true with the HIGH.