[AccessD] Filter Main Form with Subform...

Robert robert at servicexp.com
Wed Jun 25 16:29:11 CDT 2008


Susan,
 If a picture is worth a thousand words then maybe this will help...

http://www.servicexp.com/WOPic.png

The form is not finished so no grief... :-)

The field in the upper right corner is used as a quick search to narrow the
"Billing Address" subform underneath. (both subforms and main forms open
without any records) Then the user selects the customer in the billing
address, which then loads the customer info on the main form (very similar
queries) and filters the "Service Location" subform. (highlighted Service
Location Indicates the billing address) 

Does this help any..?

 So I guess from what your saying is that I need to look at using SQL to
filter the main forms query? How would I apply that SQL to the existing
query in the main form?  If you could not tell I don't know much about SQL.
:-(


Thanks for your help!!


PS: The bookmark returns empty no matter how I dim it.

WBR
 ~Robert







-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Wednesday, June 25, 2008 9:20 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Filter Main Form with Subform...

>
> I was hoping on some insight on another way to filter the records that
> would not cause this problem?

=========You want to filter the main form without affecting the subforms, is

this correct? I admit, I don't really understand this decision, but there 
are tons of ways to filter the main form -- you don't need to use .filter. I

prefer SQL myself. Is the user choosing the criteria? My favorite and 
overused method is to let the user choose and then click a Command button 
that executes a SQL statement that evaluates the values in the "criteria" 
controls. This is pretty standard and easy to do -- I suspect you've got 
something unique going on?

>
> The bookmark issue is a bit strange, I think it fails because of the
> 'requerying' of the subform, but I can't really tell. I do know the work
> around that I'm using now (and don't like) uses the records PK to lookup 
> the
> record (in a clone), grab the bookmark and then set it to the subform, 
> which
> works but is just way to slow.
>
> If I try the same exact code to grab the bookmark from the subform before
> .filter fires, I get an empty bookmark, every time without exception.

=========You are declaring the bookmark variable as a Static, right?

Susan H. 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list