Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Decimal to Hex conversion

Status
Not open for further replies.

RnRExpress

Technical User
Oct 24, 2004
53
US
Hello,

Unfortunately I am very much a novice at Access so I am hoping if someone can give me some help, or point me in the right direction.

I have a text box which is set up to enter an 11 digit number. An example would be 06701330450. I am trying to get the next field to autmatically populate with the Hexedecimal value of this number. But these numbers are too large for the simple =Hex command in Access.

Does anyone know of how to do this, whether they have done it, or know of a code to do it?

Thanks!!
 
I believe your Q has been answered in the Access Usenet newsgroup that you posted it to.
 
Can the rest of us have the answer too please? :)

Ed Metcalfe.

Please do not feed the trolls.....
 
This was posted in microsoft.public.access.modulesdaovba
by Marshall Barton:

Here's a function that should be able to deal with a string
of up to about 17 digits:

Public Function BigHex(K) As String
Dim lngHigh As Long
Dim lngLow As Long
lngHigh = Fix(CDec(K) / CDec(2 ^ 28))
lngLow = CDec(K) - CDec(lngHigh * 2 ^ 28)
BigHex = Hex(lngHigh) & Right("0000000" & Hex(lngLow), 7)
End Function

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top