Full Version: Filter record by date
UtterAccess Forums > Microsoft® Access > Access Date + Time
Hi.. All
I have a form "frmFilterIuran" as a filter to open other form "frmIuran" by date. Form " frmIuran" is base on table Iuran and its have 1 field name "TglBayar". On form "frmFilterIuran" i created 1 textbox (TglFilter) with format "dd/mm/yyyy" and 2 Butoon (cmdView and cmdClose".To open form "frmIuran" user must type date in TglFilter and then click cmdView to open Form "frmIuran" and display all records thats have TglBayar equal to TglFilter if there is no data with same date its display message "No Data"
In cmdView OnClick Event, i write this code
Dim stDoc as string
Dim stLink as string
stDoc ="frmIuran"
stLink="[Tglbayar]=" & "#" & Me!TglFilter & "#"
docmd.openform stdoc, , ,stLink
these code its working good but the problem is when i tipe date 11/01/2006 "11 January 2006", its always come with message no data and if i tipe 01/11/2006 "January 11 2006", it can display all records with TglBayar = 11 january 2006.
Regional setting on the computer is Indonesian and format date is 11-Juli-2000 or 11-07-2000.
Can anybody help me with this problem or info me why its like this....
stLink="[Tglbayar]=" & Format(CDate(Me!TglFilter), "\#mm\/dd\/yyyy\#")
Hi.. VanThienDinh
Oalready try your code and its working
Thanks a lot.. Van...
You're welcome ... Glad to help ...
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.