ES> Now when I open the form I get Error 2424 "The
ES> expression you entered has a field, control, or
ES> property name that Microsoft Access can't find".
ES> The error occurs on the 1st line of code in the
ES> Form_Current routine (DateVal = "" &
ES> Me!LotterySubmissionDate)
with serverfilterbyform, Access in fact throws another form for you to
specify the criteria, and only when you apply the filter it shows the "main"
form. I think you have to determine what mode are you in, and run the code
only when in the "regular" mode.
Vadim
----------------------------------------
Vadim Rapp Consulting
SQL, Access, VB Solutions
847-685-9073
www.vadimrapp.com
Vadim,
Thanks for your answer. How do I determine what mode the form is in ?
ServerFilterByForm boolean flag enables or disables the ServerFilter, so
I don't think I can check that property.
Ed
> I have form with an On Current event with the following code:
>
[quoted text clipped - 24 lines]
>
> Ed
Vadim Rapp - 23 Sep 2003 18:59 GMT
ES> ServerFilterByForm boolean flag enables or
ES> disables the ServerFilter
Not so. Those are two absolutely different properties, having little in
common but the name similarity. There's property serverfilterbuform, that's
what you want.
Vadim
----------------------------------------
Vadim Rapp Consulting
SQL, Access, VB Solutions
847-685-9073
www.vadimrapp.com
Ed Swartz - 23 Sep 2003 19:11 GMT
Vadim,
After some testing I discovered the following:
1) The MS Access help says that one can "determine" whether the
ServerByFilterForm is displayed or not. When I open a form with
ServerFilterByForm set to True this property displays as True when the
filter form is displayed and when the Apply Server Filter is clicked on.
Thus there is no way to determine (using this field) whether Access is
displaying the ServerByFilterForm or not.
2) The filter appears to work only on exact matches. The user can't
enter partial data for filtering (as far as I can tell).
3) If the user enters data that contains a period, like "Ed.Swartz"
Access thinks this is a table reference and an error occurs and Access
doesn't find the requested data.
Given these problems I need another solution.
Ed
> Vadim,
>
[quoted text clipped - 33 lines]
>>
>> Ed
Vadim Rapp - 24 Sep 2003 02:50 GMT
Since you already know the err.number for this particular error, write the
code appropriately:
On error goto NotRealError
DateVal = "" & Me!LotterySubmissionDate
Goto Normal
NotRealError::
if err.number<>2424 then err.raise err.number,err.source,err.description
Normal:
Vadim