Solved

When exporting data from Access to Excel, Time Field is blank

Posted on 2009-05-08
5
226 Views
Last Modified: 2013-11-27
I am using the DoCmd.TransferSpreadsheet command to transfer 16 data items in a single row of an Access table to the spreadsheet of an Excel Workbook (Headers from A1:P1, Data from A2:P2).  All data is properly exported to Excel except for the field "TIME", which holds the time the incident occurred in HH:MM "LL" ("LL" standing for AM or PM).  The field header exports fine to cell C1, but the cell where the actual time value should be, C2, is completely empty.  Any idea why only this one piece of data would not be exported?
0
Comment
Question by:jmcclosk
  • 3
  • 2
5 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 24338741
try creating a query against the table,
convert the content of the field to text  cstr([nameofField]) , save the query
then use the query for export instead of the table
0
 

Author Comment

by:jmcclosk
ID: 24338820
I tried this, but when I changed the TransferSpreadsheet command to use the query instead, I got this error:
Run-time error '3417':
An action query cannot be used as a row source.
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
ID: 24338881
why are you using an acction query, just do a simple select query
0
 

Author Closing Comment

by:jmcclosk
ID: 31579575
It works perfectly!
0
 

Author Comment

by:jmcclosk
ID: 24339014
Sorry!  That was a bone-headed move on my part.  I re-used the query originally created to make the table, but forgot to change the type.  Thanks for your help!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now