Simple date question?

virtualpete

Registered User.
Local time
Today, 10:26
Joined
Aug 25, 2010
Messages
21
Hi, I am creating a report in access via a query. I have a table of dates but I only want to include records that are older or the same as the current date. I am not sure what I should put in the criteria for it to know what the current date is.

Can anyone give me some advice.

Many thanks
 
in the criteria area of your query in the date field <=date() should work.

Tim
 
The criteria can be

<=Date()

And why do you have a table of dates?
 
Last edited:
Thanks Bob, I am using msflexgrid to keep track of some holiday bookings and I need to send various people a list of the bookings. From the table of dates I need to select only the data from the current date onwards. Just tried your suggestion >Date() in the crieria of the query and it works fine.

many thanks
 
Hi Bob, I have created a command button to mail the report. When i click on the button a pop up appears asking me to select a format. Do you know if there is a way to set it for this report to Excel?
 
Hi Bob, I have created a command button to mail the report. When i click on the button a pop up appears asking me to select a format. Do you know if there is a way to set it for this report to Excel?

What is the command button using for code or macro action when you click on it?

One way is to use

DoCmd.OutputTo acOutputReport, "ReportNameHere", acFormatXLS, "YourFilePathAndNameIncludingExtensionHere"
 
Hi Bob, this is what I have at the moment:

Dim stDocName As String

stDocName = "rptAvailabilityExport"
DoCmd.SendObject acReport, stDocName


I just tried to add , acFormatXLS so it reads
DoCmd.SendObject acReport, stDocName, acFormatXLS

But I get a warning saying no such format :(
 
What version of Access (and what Service Pack Level for Access/Office) are you using?
 
So you are emailing these (using the SendObject)? I don't have 2002 to test with so I can't verify but in 2003 the format acFormatXLS is valid. What you can do is, in the VBA Window, you place your cursor on the DoCmd.SendObject code at the SendObject part and hit F1 to bring up help about that. It might give you examples of the output formats.
 
Thansk Bob, I just tried acFormatTXT and that works fine. Maynbe I need to play around a bit to see what works best.
 

Users who are viewing this thread

Back
Top Bottom