Code:
SELECT FixturePosition, SerialNumber, TestedDate, Technician, TankTestedIn, LoadTested, PreReading, HighReading, PostReading, Recheck, PassFail, Tr343Id, MeggerID, PressureIndID, Comment
FROM tbl_343sTested
WHERE (((TestedDate)=Date()) AND ((LoadTested)=DMax("LoadTested","tbl_343sTested","[TestedDate]= #" & Date() & "#")));
In what context is this query? Is it the recordsource for the form? If not you need a way to get to the PreReading field. You can do that with the code like I gave you in post #3.
Then you will need two functions, one to convert the scale and another to get the Letter. The reason for two functions is that a function can only return one value.
Use the code like #3 to get the value of PreReading and store it in a variable like HoldPreReading.
Then
Code:
ValueFrom = UnconvertScale(HoldPreReading)
UnitsFrom = UnconvertLetter(HoldPreReading)
Code:
Private Function UnconvertScale(arg as variant) As variant
Select Case arg
Case 1000 To 999999
UnconvertScale = (arg / 1000)
Case 1000000 To 999999999
UnconvertScale = (arg / 1000000)
Case 1000000000 To 999999999999#
UnconvertScale = (arg / 1000000000)
Case Is < 1000
UnconvertScale = arg
End Select
End Function
Private Function UnconvertLetter(arg as variant) as string
Select Case arg
Case 1000 To 999999
UnconvertLetter = "K"
Case 1000000 To 999999999
UnconvertLetter = "M"
Case 1000000000 To 999999999999#
UnconvertLetter = "G"
Case Is < 1000
UnconvertLetter = ""
End Select
End Function