Server Filter value on Form property sheet got set mysteriously

  • Thread starter Thread starter E. Kwong
  • Start date Start date
E

E. Kwong

On Form1 I have a list control whose row source is a
query. When a row is doubleclicked, the record ID is
passed to Form2 to display the specific record in full and
refresh the Form1 display in the form_afterupdate sub.
Now my user got stucked once in a while: No matter which
row she doubleclicks, it will go to the SAME record. At
first I couldn't find out the cause and I just had the adp
re-installed. I did turn on debugging and check that the
correct record ID is passed.

This situation happened several times already: user edits
several records successfully, then got stucked on a single
record. We finally found out the cause recently: a
record ID is showing in the Server Filter field on the
property sheet of Form2. How it got there remains a
mystery to me. I'm thinking maybe the refreshing
(requery) on Form1's list control from Form2 has something
to do with it. Any insight appreciated.
 
Hello E.:
You wrote in conference microsoft.public.access.adp.sqlserver on Wed, 14
Apr 2004 15:42:18 -0700:

EK> No matter which row she doubleclicks, it will go to the SAME record.

When a form is opened with criteria, i.e. docmd.openform "form1",,,id=5 ,
Access sets the serverfilter for the form. If at that time you save the
form, it gets saved with that serverfilter. And then it opens with that
serverfilter, _even_ if you specify another criteria in openform - saved
serverfilter overrides the one imposed by docmd. In the above example, if
you save the form after opening it with id=5, and then you open it by
docmd.openform "form1",,,id=6 , or without any criteria, it will still show
id=5 .

All you have to do is eliminate saving the form opened with criteria.

Vadim
 
Back
Top