Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default How to get Leading Zero's passed

I have cell that contains a number with a custom format of 0000. If
there is a 1 in the cell then it displays 0001. I use the value in
that cell and when I update an Access table. When it is inserted into
the Access table it comes across as 1 instead of 0001. I have tried
changing the format in the access table but it doesn't make a
difference. I need it to go as 0001. How can I do this?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default How to get Leading Zero's passed

hi.
Formating does not change the data. it only changes the way data looks on
the sheet to humans. excel still sees it as 1 and passes it to access as 1.
the only way you might do this is to format the cell to text and do the same
in access.

Regards
FSt1

"Matt" wrote:

I have cell that contains a number with a custom format of 0000. If
there is a 1 in the cell then it displays 0001. I use the value in
that cell and when I update an Access table. When it is inserted into
the Access table it comes across as 1 instead of 0001. I have tried
changing the format in the access table but it doesn't make a
difference. I need it to go as 0001. How can I do this?

Thanks


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default How to get Leading Zero's passed

How are you updating the Access table ?

if via ADO and a recordset then:
rs.Fields("id").Value = Right("0000" & rngVal.value,4)

if via an update statement then:
sSQL = "update tblName t set t.id ='" & Right("0000" &
rngVal.value,4) & "' , t.field2 = ...." etc

Tim


"Matt" wrote in message
oups.com...
I have cell that contains a number with a custom format of 0000. If
there is a 1 in the cell then it displays 0001. I use the value in
that cell and when I update an Access table. When it is inserted into
the Access table it comes across as 1 instead of 0001. I have tried
changing the format in the access table but it doesn't make a
difference. I need it to go as 0001. How can I do this?

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Leading zero's trail Number C-Breeze Excel Worksheet Functions 3 April 7th 10 05:26 AM
Leading Zero's in Excel nobby Excel Discussion (Misc queries) 9 November 13th 08 10:05 PM
Leading Zero's LascaJ Excel Discussion (Misc queries) 1 October 28th 08 06:05 PM
How to add leading zero's LINDA Excel Worksheet Functions 1 December 12th 06 08:36 PM
Leading zero's elwyn Excel Discussion (Misc queries) 1 August 14th 05 12:37 AM


All times are GMT +1. The time now is 01:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"