Filtering dates on a list box

Dave_cha

Registered User.
Local time
Today, 21:49
Joined
Nov 11, 2002
Messages
119
Sorry guys...I need your help again.

I have a list box containing several hundred records. The second column (column(1) assuming columns start at 0) contains a log date.

I want the user to be able to filter the list box for a specified log date range without having to open a different form. The only way I can see to do this is reopen the current form using a criteria. The code below is my attempt to do this but I can't get the search criteria to work. Any ideas or suggestions as to how I might get this working? Maybe I'm going about this all wrong?

Private Sub Command21_Click()

Dim stdocname As String
Dim stlinkcriteria As String

stdocname = "FRM - Fund errors (Full errors list)"
stlinkcriteria = Me![List0].Column(1) "Between #" & [Startdate]& "# and #" & [Finishdate]& "#"

DoCmd.OpenForm stdocname, acNormal, , stlinkcriteria

End Sub

Thanks,

Dave
 
Forgot to mention re. the above, [Startdate] and [Finishdate] are both unbound fields on the same form as the list box......you probably already guessed that.
 
Why not reference the StartDate and FinishDate fields in the criteria that feeds the list box?

Then either in the after_update property of the FinishDate field, or on a command button, simply have List0.Requery
 
Thanks Matt, that did the job. Always the simple solutions that are hard to see.
 

Users who are viewing this thread

Back
Top Bottom