Insanely Simple...just not for me

cross5900

Blarg!
Local time
Today, 09:55
Joined
Mar 24, 2006
Messages
92
I am going to revise this and see if maybe that is why I am not getting responses.

I have a Form setup with an option group, for a View All and View By Date (which has 2 text boxes for the dates to be entered) and a command button that will generate the report (the VB script is already written for it to differentiate between the two choices)

What I am needing is to figure out how to get the query to work by pulling the desired dates from my date field in the source table. If anyone can help me out with this I would greatly appreciate it.

...I hate queries...
 
Last edited:
Hi,

First of all don't use "Date" as your field name. Because it's a reserved word, in Access when you say "InvDate = Date" means you enter today's date in to the InvDate field. (I made the same mistake before :D )

Use this criteria in your query under YourDate field:
Between #12/1/2001# and #2/23/2002#

Be careful when you enter dates with day numbers samller than 12. Check with your system settings, make sure that your system take the first set of number as day OR as month. If you let another user to key in the dates you should include a guide for the correct format (like dd/mm/yyy etc.).

Peter
 
I am right with you, I have everything pretty much setup, except it just doesnt know how to look for the data because I can not figure out how to work the query to tell it where the data is coming from... queries for some reason are my bane with this program.
 
resolved.

If anyone wants to know how to resolve this if they come across an issue like this. I will share my code with you.

This code is using a command button to generate a report from an option box.

Code:
Private Sub generatereport_Click()

If Frame45.Value = 1 Then
    DoCmd.OpenReport "Daily Report", acViewPreview
Else
    DoCmd.OpenReport "Daily Report", acViewPreview, , "MyDate >= #" & Me.startdate & "# And MyDate <= #" & Me.enddate & "#"
End If

End Sub

Startdate and Enddate are the text boxes where the desired date is put in.
 

Users who are viewing this thread

Back
Top Bottom