J
Jonathan
Hi
I am having a problem with some code (see below) in Project VBA. This code
compiles fine and on some machines Win 2000 and Win XP works fine. On others
we get the following error messages:-
The entry is not valid.
The test value cannot be used with the field for the data you want to find
or filter for.
Then get
An unexpected error occurred with the method.
As the "test" parameter is direct from help file and works on some machines
at a loss as why this doesn't work.
Tried reinstalling Project and didn't fix
Tried making sure user has full admin rights to desktop and that didn't help.
Any ideas?
Thanks
Jonathan.
Private Sub cmdOK_Click()
Dim dtFilterDate As Date
dtFilterDate = DateAdd("h", 5, CDate(Right$(dtpDate, 11)))
On Error GoTo Err_cmdOK_Click
FilterEdit Name:="FilterByDay", Create:=True, TaskFilter:=True,
OverwriteExisting:=True, FieldName:="Start", _
test:="is greater than or equal to", Value:=dtFilterDate,
Operation:="and", ShowSummaryTasks:=True
FilterEdit Name:="FilterByDay", Create:=False, TaskFilter:=True,
OverwriteExisting:=False, newfieldname:="Start", _
test:="is less than or equal to", Value:=DateAdd("d", 1,
dtFilterDate), ShowSummaryTasks:=True
FilterApply Name:="FilterByDay"
Err_cmdOK_Click:
End
End Sub
I am having a problem with some code (see below) in Project VBA. This code
compiles fine and on some machines Win 2000 and Win XP works fine. On others
we get the following error messages:-
The entry is not valid.
The test value cannot be used with the field for the data you want to find
or filter for.
Then get
An unexpected error occurred with the method.
As the "test" parameter is direct from help file and works on some machines
at a loss as why this doesn't work.
Tried reinstalling Project and didn't fix
Tried making sure user has full admin rights to desktop and that didn't help.
Any ideas?
Thanks
Jonathan.
Private Sub cmdOK_Click()
Dim dtFilterDate As Date
dtFilterDate = DateAdd("h", 5, CDate(Right$(dtpDate, 11)))
On Error GoTo Err_cmdOK_Click
FilterEdit Name:="FilterByDay", Create:=True, TaskFilter:=True,
OverwriteExisting:=True, FieldName:="Start", _
test:="is greater than or equal to", Value:=dtFilterDate,
Operation:="and", ShowSummaryTasks:=True
FilterEdit Name:="FilterByDay", Create:=False, TaskFilter:=True,
OverwriteExisting:=False, newfieldname:="Start", _
test:="is less than or equal to", Value:=DateAdd("d", 1,
dtFilterDate), ShowSummaryTasks:=True
FilterApply Name:="FilterByDay"
Err_cmdOK_Click:
End
End Sub