Increment a hexadecimal number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Has anyone written a script to increment a hexadecimal number? We want to
keep track of the the Mac Addresses that we're using. Basically, I'm
thinking of keeping the last used hex number in a table so that anytime a new
one is used, it gets incremented and updated. Any help would be appreciated.
thanks in advance.
 
You may want to snoop around to see if there's a function that will
convert a number to HEX and go that route. Adding 1 to a Base10 number
and then converting to HEX might be easier than trying to Add 1 to a
Base6 number.
 
Hey, you're making me work here.

VBA does have a function HEX([parameter]) which will convert a number.
 
Samantha,

Hex("&HEE"+1)

....or if you're using a variable...

strHex = "&HEE"
Hex(strHex+1)

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Hi,


Interesting, I mean, I though your expression would err, as in:

? "HEE"+1


(which is a general error when you use a string argument and a numerical
argument with the + operator)


but in any case, the " are not required:


? &HEE+1, Hex(&HEE + 1)
239 EF



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top