filter date on form

Richio

Registered User.
Local time
Today, 11:13
Joined
May 31, 2002
Messages
75
Strange....

I have a continuous form set up - basically one long list of records.

The form has a custom toolbar with the A-Z, Z-A, Filter by selection (the funnel) and remove filter buttons.

It all seems to work fine. Ie sorting records into date order. Click on "a supplier" and it selects only these records.

My problem is that if I click on a date, say 30/09/02 for example then filter by selection it does not filter, but sorts, if I click again it does filter but only to the record at the top of the list.

Ideally I want to be able to click on any date and filter to these records only.

Any ideas?

Richio
 
Sussed It.

I have removed the input mask on the date format - this is great on read only fields, but would still like an input mask on the fields requiring input.

I assume this is some sort of bug.
 
Richio

Have a look at this


Private Sub fld_Date_Click()

Dim DateClicked As Date
DateClicked = Me.fld_Date

If IsNull(DateClicked) Then ' Click date on new record to show all records again
Me.RecordSource = "SELECT Table1.*, Table1.Field1 FROM Table1;"
Else
' Recalculate Recordsource using DateClick
Me.RecordSource = "SELECT Table1.*, Table1.Field1 FROM Table1 WHERE ((Table1.Field1)=#" & Format(DateClicked, "MM/DD/YYYY") & "#);"
End If

End Sub



Smed
 

Users who are viewing this thread

Back
Top Bottom