Solved

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

Posted on 2009-05-08
5
227 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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

825 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