M
Maury Markowitz
I have a form that displays the output from a fairly complex VIEW. In order
to keep the display time down to something reasonable, I've put two date
fields onto the screen to limit the records to ones between those two dates.
In the Form_Open I set the dates to three days in the past to three days in
the future, then use that in the ServerFilter...
Private Sub Form_Open(Cancel As Integer)
Me!FromDate = DateAdd("d", -3, Date)
Me!ToDate = DateAdd("d", 3, Date)
Me.ServerFilter = "SettleDate >= '" & Me!FromDate & "' and SettleDate <=
'" & Me!ToDate & "'"
Me.OrderBy = "SettleDate"
Me.OrderByOn = True
Me.Refresh
End Sub
This works fine, although the ordering does NOT work properly.
Anyway when the user changes the fields I want the records to change as
well. Yet the following code does nothing...
Private Sub FromDate_AfterUpdate()
Me.ServerFilter = "SettleDate >= '" & Me!FromDate & "' and SettleDate <=
'" & Me!ToDate & "'"
Me.Requery
Me.Refresh
End Sub
Private Sub ToDate_AfterUpdate()
Me.ServerFilter = "SettleDate >= '" & Me!FromDate & "' and SettleDate <=
'" & Me!ToDate & "'"
Me.Requery
Me.Refresh
End Sub
It looks the same to me, so why does it work the first time and then not
from then on?
Maury
to keep the display time down to something reasonable, I've put two date
fields onto the screen to limit the records to ones between those two dates.
In the Form_Open I set the dates to three days in the past to three days in
the future, then use that in the ServerFilter...
Private Sub Form_Open(Cancel As Integer)
Me!FromDate = DateAdd("d", -3, Date)
Me!ToDate = DateAdd("d", 3, Date)
Me.ServerFilter = "SettleDate >= '" & Me!FromDate & "' and SettleDate <=
'" & Me!ToDate & "'"
Me.OrderBy = "SettleDate"
Me.OrderByOn = True
Me.Refresh
End Sub
This works fine, although the ordering does NOT work properly.
Anyway when the user changes the fields I want the records to change as
well. Yet the following code does nothing...
Private Sub FromDate_AfterUpdate()
Me.ServerFilter = "SettleDate >= '" & Me!FromDate & "' and SettleDate <=
'" & Me!ToDate & "'"
Me.Requery
Me.Refresh
End Sub
Private Sub ToDate_AfterUpdate()
Me.ServerFilter = "SettleDate >= '" & Me!FromDate & "' and SettleDate <=
'" & Me!ToDate & "'"
Me.Requery
Me.Refresh
End Sub
It looks the same to me, so why does it work the first time and then not
from then on?
Maury