Date problem

coley

Coley
Local time
Today, 19:45
Joined
Feb 22, 2005
Messages
39
Hi


I use the following code to run a report showing selected dates,

Private Sub Command7_Click()
If Not IsNull(Me.txtFromDate) And IsNull(Me.txtToDate) Then
MsgBox "You must enter a To Date, please try again.", vbCritical
Me.txtToDate.SetFocus
Exit Sub
End If
DoCmd.OpenReport "Select Date", acViewPreview
End Sub

It works fine apart from it does not show any fields when I select any dates in April 2005.

Does anyone know why it is doing this? Not selecting any field with current month in, new to me!

Many thanks

Keith
 
And you do have records in your table between Apr 1st and Apr 4th?
 
yes, dates all there
 
Check that you are using American date formats. British ones, for example 01/04/05 can be mistaken for the 4th January.
 
date formats are all correct

so weird :confused:

if i put in a range of 01/02/05 to 04/04/05
it pulls out everything from 01/02/05 up to 31/03/05
 
I have found the cause, but not the soloution

It is not showing any new records I entered, on the report i run using this code:

Private Sub Command7_Click()
If Not IsNull(Me.txtFromDate) And IsNull(Me.txtToDate) Then
MsgBox "You must enter a To Date, please try again.", vbCritical
Me.txtToDate.SetFocus
Exit Sub
End If
DoCmd.OpenReport "Select Date", acViewPreview
End Sub

what i am doing wrong?
 
dont think this is what i am looking for, but thanks anyway,

I enter new records in another form, when i open the table the new records are there but they do not show on the report.
 
sorted!!

the problem was in the query, and the join properties not the code

thanks to all that helped

Keith
 

Users who are viewing this thread

Back
Top Bottom