[AccessD] Finders problem

Asger Blond ab-mi at post3.tele.dk
Wed Jul 16 19:07:09 CDT 2008


Arthur,

1. Have the rowsource for your dropdown select all the columns of the form's
recordsource (eventually set column width to 0 for columns not to be
displayed).
2. On the form's ApplyFilter event:

Private Sub Form_ApplyFilter(Cancel As Integer, ApplyType As Integer)
	If Me.Filter <> "" Then
		cboFinders.RowSource = "SELECT * FROM " & _ 
			Me.RecordSource & " WHERE " & Me.Filter
	Else
		cboFinders.RowSource = Me.RecordSource
	End If
End Sub

HTH
Asger
-----Oprindelig meddelelse-----
Fra: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] På vegne af Arthur Fuller
Sendt: 16. juli 2008 23:37
Til: Access Developers discussion and problem solving
Emne: [AccessD] Finders problem

I have two controls on a form that I call "Finders". They are
straightforward dropdowns listing the Site numbers and Site Names. The
problem I'm having is that once I execute the Filter By Form code, the
Finders still list the entire recordset. Suppose that the original recordset
has 50 rows, and you then execute FBF, reducing the set to 10 rows. How can
I refresh the rowsource of the Finders to exclude everything but the 10 rows
isolated by the filter?

I'm using code by Stan Getz to do the filter operation and it works great.
No issues there. The only question is how to refresh my Finders after an FBF
operation. They start out as "SELECT SiteID, SiteName FROM Sites" and so on.


So now the user imposes a filter, and the result is that the filter property
now says "(([SitemCity] LIKE "Toronto*") AND ([SiteUTMnorth] = 0))". So do I
just change the rowsource property of the Finders to concatenate the filter
to the previous rowsource? And then when the user kills the filter, change
the rowsources back to their original values (I could store that in their
Tag properties and then just grab it back from there).

I hope this explanation was clear enough to give you the picture.

TIA for any advice.
Arthur
-- 
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