473,609 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Excel Format Help

EJO
TIA, it is much appreciated!

I export data from A2k to Excel 2k, and everything runs nicely...except
when i export a particular A2k number field. The field in access is a
numeric with two decimals. When exported, everything to the right of
the decimal is dropped (whether or not the number is "0"). In my Excel
template, the entire sheet is formatted as text (and must be that way
for later use by another system). I have tried to set my concerned
value as cstr(rstEquip2![EHSN #]) in both the query and in vba and
still lose everything after the decimal. I would have thought that
Excel would pay attention that the sheet was explicitly set to text
before it was updated, then even more so considering the data was
converted to text prior to export. I would rather not change the data
type in the table to text to get this to work--the proper data type is
used for other purposes.

Do While Not rstEquip2.EOF
XOset2 = 25 + i1 + i2
.Cells(XOset2, 1).Value = rstEquip2![Stock]
.Cells(XOset2, 2).Value = rstEquip2![Activity]
.Cells(XOset2, 3).Value = rstEquip2![Equip Owned]
.Cells(XOset2, 4).Value = rstEquip2![Manufacturer]
---> help!! .Cells(XOset2, 5).Value = rstEquip2![EHSN#]
.Cells(XOset2, 6).Value = rstEquip2![Qty]
.Cells(XOset2, 7).Value = rstEquip2![Part Number]
.Cells(XOset2, 8).Value = rstEquip2![Description]
.Cells(XOset2, 9).Value = ""
.Cells(XOset2, 10).Value = "$ -"
.Cells(XOset2, 11).Value = ""
rstEquip2.MoveN ext
i2 = i2 + 1
Loop

Nov 13 '05 #1
2 1582
Try
.Cells(XOset2, 5).Value = cstr(Format(rst Equip2![EHSN#],"Fixed"))
or whatever other format you need

Phil

"EJO" <5p****@century tel.net> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
TIA, it is much appreciated!

I export data from A2k to Excel 2k, and everything runs nicely...except
when i export a particular A2k number field. The field in access is a
numeric with two decimals. When exported, everything to the right of
the decimal is dropped (whether or not the number is "0"). In my Excel
template, the entire sheet is formatted as text (and must be that way
for later use by another system). I have tried to set my concerned
value as cstr(rstEquip2![EHSN #]) in both the query and in vba and
still lose everything after the decimal. I would have thought that
Excel would pay attention that the sheet was explicitly set to text
before it was updated, then even more so considering the data was
converted to text prior to export. I would rather not change the data
type in the table to text to get this to work--the proper data type is
used for other purposes.

Do While Not rstEquip2.EOF
XOset2 = 25 + i1 + i2
.Cells(XOset2, 1).Value = rstEquip2![Stock]
.Cells(XOset2, 2).Value = rstEquip2![Activity]
.Cells(XOset2, 3).Value = rstEquip2![Equip Owned]
.Cells(XOset2, 4).Value = rstEquip2![Manufacturer]
---> help!! .Cells(XOset2, 5).Value = rstEquip2![EHSN#]
.Cells(XOset2, 6).Value = rstEquip2![Qty]
.Cells(XOset2, 7).Value = rstEquip2![Part Number]
.Cells(XOset2, 8).Value = rstEquip2![Description]
.Cells(XOset2, 9).Value = ""
.Cells(XOset2, 10).Value = "$ -"
.Cells(XOset2, 11).Value = ""
rstEquip2.MoveN ext
i2 = i2 + 1
Loop

Nov 13 '05 #2
EJO
Thanks, Phil. Haven't had a chance to test it yet, but thnx all the
same!

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
35520
by: Allison Bailey | last post by:
Hi Folks, I'm a brand new Python programmer, so please point me in the right direction if this is not the best forum for this question.... I would like to open an existing MS Excel spreadsheet and extract information from specific worksheets and cells. I'm not really sure how to get started with this process. I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
8
6545
by: Nick M | last post by:
Hello All, Excellent info here Thanks! I am very new to using access in general and I am on a learning curve. I'm trying to import an excel workbook (with worksheets) into an access db via a macro. (I'll get to using VB later on). What I would like to do is import a single workbook w/three seperate worksheets into three seperate access tables AND truncate the time stamp that is used in the excell sheet via a macro.
5
8664
by: Igor | last post by:
Hi everyone! I have a question about exporting data to Microsoft Excel. I am writing program in C# and have to export some data to excel workbook. It works very good using OLE technology, but it requires Microsoft Excel installed on every machine with my program. It is not quite convenient to do so. Is there another way to export data to Excel, or how simply create file of Microsoft Excel format from my program (of cause, the format of...
2
30570
by: Kumar | last post by:
Hi Folks, I have a question regarding my windows c# application. This application just reads MS Excel file and puts the data in to sql server database. In that excel file ,it has one named cell as "OutputStampTime". I am facing problem while accessing this cell value. When I open excel, I can see the value as "6:49 AM" . But when I click on that cell in the formula bar I am seeing as 01/27/2005 06:49:47 AM.
2
6916
by: Mustufa Baig | last post by:
Hi everybody, I have an ASP.NET website where clients can view their monthly billings by selecting different options. One of the option is the way they want to see the report i.e. whether they want to see it in PDF or EXCEL etc etc..... What I am trying to acheive is depending on their choice of format, I want to send the stream of that particulae selected format to the browser. I have tried couple od solutions but I couldn't able to get...
9
22488
by: dba123 | last post by:
I need some help and direction on what classes and an example or two (article) on how to read an Excel Worksheet and insert one column into a database table column. I am using .NET 2.0 only. What namespaces and classes should I use and how? -- dba123
0
1367
by: ammu001 | last post by:
Response.ContentType Excel I am trying to export a datagrid into an excel sheet. What it now does is the entire page is saved as an excel sheet in XlHtml file format. I want it in xlWorkbookNormal format and also have to delete that extra blank space in the excel sheet. Please help out if somebody knows. Dim dt As DataTable = GetDataTableFromDatabase() GridView2.DataSource = dt GridView2.DataBind()
2
3113
by: Mad Scientist Jr | last post by:
>From an asp.net web page I want the user to open the results of a SQL query in Excel, as automatically as possible (ie not having to loop through columns, rows, in code). For this, dataset.writexml works great (got the code from http://forums.devx.com/archive/index.php/t-57273.html ) The only question I have is, when Excel opens up, it isn't the view I would prefer. It opens as a read-only workbook, I would prefer as an
10
3110
by: Esmael | last post by:
Hi to all, /*****************************/ OS-WIn XP SP2 VB6 SP6 /*****************************/ Is their anyone who can help me with this: Source code written on VB6.
18
13025
by: Dirk Hagemann | last post by:
Hello, From a zone-file of a Microsoft Active Directory integrated DNS server I get the date/time of the dynamic update entries in a format, which is as far as I know the hours since january 1st 1901. For Example: the number 3566839 is 27.11.07 7:00. To calculate this in Excel I use this: ="01.01.1901"+(A1/24-(REST(A1;24)/24))+ZEIT(REST(A1;24);0;0) (put 3566839 in field A1 and switch the format of the result-field to the corresponding...
0
8130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8573
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8406
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5510
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4021
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.