Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / September 2003

Tip: Looking for answers? Try searching our database.

ServerFilterByForm and On Current Event problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed Swartz - 22 Sep 2003 20:45 GMT
I have form with an On Current event with the following code:

Private Sub Form_Current

    DateVal = "" & Me!LotterySubmissionDate

    If DateVal = "01-Jan-1900" Then
        DateVal = "In Queue"
    End If

    Me!LotterySubmissionDate2 = DateVal
End Sub

This worked fine in the past

Today I enabled the ServerFilterByForm.

Now when I open the form I get Error 2424 "The expression you entered
has a field, control, or property name that Microsoft Access can't
find". The error occurs on the 1st line of code in the Form_Current
routine (DateVal = "" & Me!LotterySubmissionDate)

When selected records are found I need to check the Lottery Submission
Date and if 01-Jan-1900 I need to set it to "In Queue".

Any ideas how to workaround this problem ?

Ed
Vadim Rapp - 22 Sep 2003 21:37 GMT
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
Ed Swartz - 23 Sep 2003 17:52 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.