Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-05-08
5
Medium Priority
?
232 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 1000 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

885 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