If you look in Access help, there is a built-in function called HEX2DEC
which does exactly that, but there's awarning it may not work in the absense
of a certain DLL - and indeed it doesn't on my machine. Therefore I have
written my own function in VBA to do it. Just paste in a general module:
Function H2D(vHex As String)
ttl = "Conversion Error"
sl = Len(vHex)
If sl > 14 Then
msg = "HEX number length must be up to 14 characters!"
MsgBox msg, vbCritical, ttl
H2D = "*Error"
Exit Function
End If
For i = sl To 1 Step -1
d = Mid(vHex, sl - i + 1, 1)
Select Case d
Case "0" To "9"
dv = Val(d)
Case "A" To "F"
dv = Asc(UCase(d)) - 55
Case Else
msg = "Invalid character in HEX number!"
MsgBox msg, vbCritical, ttl
H2D = "*Error"
Exit Function
End Select
v = v + dv * 16 ^ (i - 1)
Next
H2D = v
End Function
Then you can call it from anywhere in your project as H2D(argument).
HTH,
Nikos