Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    69

    Unanswered: DEX2HEX(decnumber,numberofdigits)

    Is it possible to use the DEC2HEX function in Access's VBA. I want to be able to convert a decimal eg 277 to hex number i.e 115 but make the number 4 digits long. It need to be four digits because its actual the month and day of a date which I need to extract. i,e. 15 of the 1st
    I require it to alway be four digits so when I use the Mid function to get the first two characters I get the 01 instead of 11. It also needs to work for 1115 or 15 of the 11th. I can only find the Hex function in VBA and you can't specify the number of digits like you can with the DEC2HEX function.

  2. #2
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Here is an article to get you going, although I have to ask why? There are plenty of date functions within Access. Won't any of them do the job?

    http://www.vb-helper.com/howto_dec_hex_oct_bin.html

  3. #3
    Join Date
    Mar 2004
    Posts
    69
    Cheers I've already sorted it thogh by creating my own DEC2HEX function which makes the result always four digits.
    Quote Originally Posted by DJN
    Here is an article to get you going, although I have to ask why? There are plenty of date functions within Access. Won't any of them do the job?

    http://www.vb-helper.com/howto_dec_hex_oct_bin.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •