Hex to dec conversion

A

Andy

I have an Access database that is updated by scanning barcodes into FP 2000
asp pages. The database is on our SQL server. There is a field that has
hexidecimal data in it such as F60C0420. What I need to do is to convert this
to decimal format when it's entered and automatically populate another field.
Also, there is a constant prefix of 24600 in the decimal format.

Is this possible in Access? If so, how?
 
A

Andy

Do I assign that by using the Default value property for the field that is to
be decimal format? Also, is "MyHexField" the field where the hexidecimal data
is?

Allen Browne said:
Try assigning:
Val("&H" & [MyHexField])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Andy said:
I have an Access database that is updated by scanning barcodes into FP 2000
asp pages. The database is on our SQL server. There is a field that has
hexidecimal data in it such as F60C0420. What I need to do is to convert
this
to decimal format when it's entered and automatically populate another
field.
Also, there is a constant prefix of 24600 in the decimal format.

Is this possible in Access? If so, how?
 
A

Allen Browne

No, and Yes.

If you are importing data in hex format, it will need to come into a Text
field. You can then use an Update query to populate the numeric field.
(Update on Query menu, in query design.)

The expression goes into the Update row, under the numeric field. And yes,
replace "MyHexField" with the name of your hex field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Andy said:
Do I assign that by using the Default value property for the field that is
to
be decimal format? Also, is "MyHexField" the field where the hexidecimal
data
is?

Allen Browne said:
Try assigning:
Val("&H" & [MyHexField])

Andy said:
I have an Access database that is updated by scanning barcodes into FP
2000
asp pages. The database is on our SQL server. There is a field that has
hexidecimal data in it such as F60C0420. What I need to do is to
convert
this
to decimal format when it's entered and automatically populate another
field.
Also, there is a constant prefix of 24600 in the decimal format.
 
A

Andy

Thanks

Allen Browne said:
No, and Yes.

If you are importing data in hex format, it will need to come into a Text
field. You can then use an Update query to populate the numeric field.
(Update on Query menu, in query design.)

The expression goes into the Update row, under the numeric field. And yes,
replace "MyHexField" with the name of your hex field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Andy said:
Do I assign that by using the Default value property for the field that is
to
be decimal format? Also, is "MyHexField" the field where the hexidecimal
data
is?

Allen Browne said:
Try assigning:
Val("&H" & [MyHexField])

I have an Access database that is updated by scanning barcodes into FP
2000
asp pages. The database is on our SQL server. There is a field that has
hexidecimal data in it such as F60C0420. What I need to do is to
convert
this
to decimal format when it's entered and automatically populate another
field.
Also, there is a constant prefix of 24600 in the decimal format.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top