[AccessD] Filter Main Form with Subform...

Robert robert at servicexp.com
Tue Jun 24 16:23:28 CDT 2008


Nobody...?


~Robert

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Robert
Sent: Monday, June 23, 2008 7:40 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Filter Main Form with Subform...

I'm trying to filter the main form (and a 2nd subform) from a selection in
the 1st subform like this.. (Both subforms are not linked whatsoever they
just sit on the main form)  Access 2007 (but does the same thing in 2003)


Me.parent.form.filter = "[Customer ID] = " & CID
Me.parent.form.filterOn = True

Me.parent.ctrsubform.form.filter = "[lEKey] = " & m_lEKey
Me.parent.ctrsubform.form.filterOn = True


The problem is when the code hits the first Me.parent.form.filter =
"[Customer ID] = " & CID, the 1st subform requery, and the record position
the user selected is lost (record at top of list is highlighted). (But the
main form (and 2nd subform are filtered  correctly)

I have tried to store the Bookmark and re-apply but for some reason I can't
grab a valid Bookmark from the subform.

So I ended up using the subform PK to perform a search and then move to the
record that was selected in the subform. 

The problem with this approach is it takes a bit of time to complete the
cycle and re-look up the selected record. Is there a way to keep the 1st
subfrom from requiring?


PS: I'm terrible at SQL....


TIA
~Robert










-- 
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