Form Filter is removed on requery or F5

  • Thread starter hydroparadise via AccessMonster.com
  • Start date
H

hydroparadise via AccessMonster.com

For some reason the filter is is removed once the form has been requeried or
"refreshed" (F5). Is there an event thats triggered associated to requerying
so I might to try to reverse this action or is there a way to keep this
happening all together. I am using the DoCmd.OpenForm method to open and
filter the form base on a record that is currently open. Heres the code

DoCmd.OpenForm "BidTakeOffDetails", acNormal, , "TakeOffID = " Me.
TakeOffItemID.Value, acFormEdit, acWindowNormal

A side problem with using adp is that unless I provide someway to clearing
Form.Filter and Form.ServerFilter, those properties are saved to the first
occurance of the filter. From that point on, no matter whats used to filter
the form, it continues to filter what what was filtered previouly. Seems
like this was different using Jet/Ace.
 
S

Sylvain Lafontaine

The best solution would be to stop using .Filter and .ServerFilter.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
H

hydroparadise via AccessMonster.com

Ok, then let me explain my situation...
I have three tables; bids, takeoff, and takeoffdetails

Configuration is as follows.
bids 1:M takeoff
takeoff 1:M takeoffdetails

I want the user to be able to select a bid, and then be able to veiw all the
takeoff items for that bid and then further into the takeoffdetails. The
aforementioned method works well for Access .mdb, is there a better way for .
adp?

Sylvain said:
The best solution would be to stop using .Filter and .ServerFilter.
For some reason the filter is is removed once the form has been requeried
or
[quoted text clipped - 13 lines]
the form, it continues to filter what what was filtered previouly. Seems
like this was different using Jet/Ace.
 
S

Sylvain Lafontaine

I don't see the advantage of using ADP instead of a MDB file with ODBC
Linked tables if you are to use Filter and ServerFilter. The advantage of
ADP is that you can directly call stored procedures (SP) as well as make
direct SQL Queries (the equivalent of passthrough queries) while having them
Read/Write instead of Read Only.

I'm not sure how you are getting your data to the forms but if you are
exclusively using Filters and ServerFilters at this moment; there is no
advantage of switching to ADP.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


hydroparadise via AccessMonster.com said:
Ok, then let me explain my situation...
I have three tables; bids, takeoff, and takeoffdetails

Configuration is as follows.
bids 1:M takeoff
takeoff 1:M takeoffdetails

I want the user to be able to select a bid, and then be able to veiw all
the
takeoff items for that bid and then further into the takeoffdetails. The
aforementioned method works well for Access .mdb, is there a better way
for .
adp?

Sylvain said:
The best solution would be to stop using .Filter and .ServerFilter.
For some reason the filter is is removed once the form has been
requeried
or
[quoted text clipped - 13 lines]
the form, it continues to filter what what was filtered previouly.
Seems
like this was different using Jet/Ace.
 
H

hydroparadise via AccessMonster.com

Actually, just wrote my first trigger and stored procedure as of yesterday,
and boy what a difference. I have had a paradigm shift and see I have much
to learn. This is what I gather... Let access do all the pretty work and SQL
Server handle all the data manipulation as much as possible.

Thanks guys!

Sylvain said:
I don't see the advantage of using ADP instead of a MDB file with ODBC
Linked tables if you are to use Filter and ServerFilter. The advantage of
ADP is that you can directly call stored procedures (SP) as well as make
direct SQL Queries (the equivalent of passthrough queries) while having them
Read/Write instead of Read Only.

I'm not sure how you are getting your data to the forms but if you are
exclusively using Filters and ServerFilters at this moment; there is no
advantage of switching to ADP.
Ok, then let me explain my situation...
I have three tables; bids, takeoff, and takeoffdetails
[quoted text clipped - 19 lines]
 
S

Sylvain Lafontaine

The use of Insert and Update triggers is not really compatible with ADP but
using stored procedures (SP) is fine. For calling a SP as the record source
of a form, you can build a string with all the parameters if you start your
string with the EXEC command:

MyForm.RecordSource = "EXEC MySP Parm1, Parm2, ..."

Don't forget to enclose the string parameters between single quotes:

MyForm.RecordSource = "EXEC MySP Parm1, '" & Replace (Value2, "'", "''") &
"'"

The second way of calling a SP with parameters is to use the InputParameters
property to pass the values of each parameters from controls on the form.
This is usually the way that I'm using myself. For having a read/write
form, you might also have to set the UniqueTable and the ResyncCommand
properties if the query is complex. These points have been discussed many
times in the past in this newsgroup.

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)


hydroparadise via AccessMonster.com said:
Actually, just wrote my first trigger and stored procedure as of
yesterday,
and boy what a difference. I have had a paradigm shift and see I have
much
to learn. This is what I gather... Let access do all the pretty work and
SQL
Server handle all the data manipulation as much as possible.

Thanks guys!

Sylvain said:
I don't see the advantage of using ADP instead of a MDB file with ODBC
Linked tables if you are to use Filter and ServerFilter. The advantage of
ADP is that you can directly call stored procedures (SP) as well as make
direct SQL Queries (the equivalent of passthrough queries) while having
them
Read/Write instead of Read Only.

I'm not sure how you are getting your data to the forms but if you are
exclusively using Filters and ServerFilters at this moment; there is no
advantage of switching to ADP.
Ok, then let me explain my situation...
I have three tables; bids, takeoff, and takeoffdetails
[quoted text clipped - 19 lines]
Seems
like this was different using Jet/Ace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top