Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 02-28-2018, 06:44 AM   #16
gippsy
Newly Registered User
 
Join Date: Dec 2012
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
gippsy is on a distinguished road
Re: exported query to excel with dates range file name

BoBaxter

I ran the code you recommend me. However, anytime I enter the same date or different dates, vba displays error 13 in this line:
If DateValue(Me.txtday1) = DateValue(Me.txtplot) Then

I have been trying by my self to fix such error with no success.

Could you suggest me how to fix the code?

Once again many thanks

PS. have been facing problems to attach the image to this message. Anytime I try to upload the image or to send the message the page web page falls.

gippsy is offline   Reply With Quote
Old 02-28-2018, 06:52 AM   #17
gippsy
Newly Registered User
 
Join Date: Dec 2012
Posts: 24
Thanks: 1
Thanked 0 Times in 0 Posts
gippsy is on a distinguished road
Re: exported query to excel with dates range file name

BoBaxter.

In my previous message, the access-programmers website didnīt allow to send the image that illustrates the error.
gippsy is offline   Reply With Quote
Old 02-28-2018, 07:18 AM   #18
Gasman
Access newbie
 
Join Date: Sep 2011
Location: Swansea, South Wales,UK
Posts: 1,794
Thanks: 233
Thanked 257 Times in 242 Posts
Gasman will become famous soon enough Gasman will become famous soon enough
Re: exported query to excel with dates range file name

gippsy,
Take a step back and look at what you are trying to do.

You need to compare your dates. I *thought* plot was just a number?, not a date.

So take it in small steps.
Compare your dates. If the same just build your filename with the one date, else build it with first date, then last date.
Then add what is common to the file name, the "qry01" and then the plot number.

Work out in your head how you would do it on paper, then try and then try and do the same in code.

Error 13 is a type mismatch error.


__________________
Access novice. Sometimes trying to give something back.
Access 2007
Gasman is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Access Exported data to Excel....Excel file Error sumox Modules & VBA 4 05-28-2014 08:48 AM
Format Exported Excel File mubi_masti Modules & VBA 9 10-10-2011 12:26 AM
check for excel version before opening file exported from access query wiklendt Modules & VBA 5 11-13-2009 12:40 PM
exported excel file has no formatting tommy_mo Excel 1 10-23-2006 07:35 AM
Exported excel file has no formatting tommy_mo Forms 3 10-21-2006 04:01 AM




All times are GMT -8. The time now is 11:16 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World