dbTalk Databases Forums  

Filter by Form

comp.databases.ms-access comp.databases.ms-access


Discuss Filter by Form in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Phil Rushton
 
Posts: n/a

Default Filter by Form - 02-21-2011 , 05:37 AM






Is there a way to program the filter by form view so I can customise it?

Phil

Reply With Quote
  #2  
Old   
Access Developer
 
Posts: n/a

Default Re: Filter by Form - 02-21-2011 , 10:27 PM






You can't "program the filter by form view", but you can very easily create
a form for entering values from which you can create a query to "filter" the
results. It really makes sense to thoughtfully design your database
applications rather than trying to "adapt" the end-user capabilities and
rely on the user to know how they should be used.

Larry Linson
Microsoft Office Access MVP


"Phil Rushton" <phil.rushton (AT) age-concern-cardiff (DOT) org.uk> wrote

Quote:
Is there a way to program the filter by form view so I can customise it?

Phil

Reply With Quote
  #3  
Old   
Phil
 
Posts: n/a

Default Re: Filter by Form - 02-22-2011 , 02:38 AM



On 22/02/2011 04:26:58, "Access Developer" wrote:
Quote:
You can't "program the filter by form view", but you can very easily
create a form for entering values from which you can create a query to
"filter" the results. It really makes sense to thoughtfully design your
database applications rather than trying to "adapt" the end-user
capabilities and rely on the user to know how they should be used.

Larry Linson
Microsoft Office Access MVP


"Phil Rushton" <phil.rushton (AT) age-concern-cardiff (DOT) org.uk> wrote in message
news:0bSdndqmzOYR0__QnZ2dnUVZ8sOdnZ2d (AT) bt (DOT) com...
Is there a way to program the filter by form view so I can customise it?

Phil



Not that it's much help, but I have a form called SysFilterby form.
Unfortunately I had to buy it, and it is not perfect, but pretty good. See
http://www.accesstogo.org.uk/Filter_By_Form.html Phil

Reply With Quote
  #4  
Old   
Access Developer
 
Posts: n/a

Default Re: Filter by Form - 02-22-2011 , 07:14 PM



There have been, over the years, quite a few examples of Query by Form (for
free). I've done a few, but have never had occasion to want to do a
"general" one -- all of mine have been customized for the particular
application.

Larry Linson
Microsoft Office Access MVP

"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote

Quote:
On 22/02/2011 04:26:58, "Access Developer" wrote:
You can't "program the filter by form view", but you can very easily
create a form for entering values from which you can create a query to
"filter" the results. It really makes sense to thoughtfully design your
database applications rather than trying to "adapt" the end-user
capabilities and rely on the user to know how they should be used.

Larry Linson
Microsoft Office Access MVP


"Phil Rushton" <phil.rushton (AT) age-concern-cardiff (DOT) org.uk> wrote in message
news:0bSdndqmzOYR0__QnZ2dnUVZ8sOdnZ2d (AT) bt (DOT) com...
Is there a way to program the filter by form view so I can customise it?

Phil




Not that it's much help, but I have a form called SysFilterby form.
Unfortunately I had to buy it, and it is not perfect, but pretty good. See
http://www.accesstogo.org.uk/Filter_By_Form.html Phil

Reply With Quote
  #5  
Old   
Jon Lewis
 
Posts: n/a

Default Re: Filter by Form - 02-23-2011 , 05:43 AM



Yes you can intercept the Filter Event of a Form. Below is part of a
routine I use.
The advantage of this approach against a completely seperate filter form is
that you can still use the built in filtering buttons.(Apply, Clear Grid,
Close etc.)

Private Sub Form_Filter(Cancel As Integer, FilterType As Integer)
On Error GoTo Err_Form_Filter
'Kick in Before Update Event if applicable before other stuff in this
procedure
'But only if AllowEdits = True
If Me.AllowEdits = True Then
DoCmd.RunCommand acCmdSaveRecord
End If
'Cancel choice of BeforeUpdate dialog produces error 2501 by which
'error handler can exit and Cancel Form_Filter_Event
If FilterType = 0 Then 'Filter By Form
'******
'Your code here to customise the form
'e.g. make some controls invisible/disabled
'remove any default settings
'remove any values from unbound fields etc
'REVERSE THESE CHANGES IN THE FORM'S On Apply Filter EVENT
'******
End If

Exit_Form_Filter:
Exit Sub
Err_Form_Filter:
Select Case Err.Number
Case 2501, 2001
Cancel = True 'Cancel Filter when Cancel chosen in Before Update
dialog.
Case Else
MsgBox Err.Number & ": " & Err.Description
End Select
Resume Exit_Form_Filter
End Sub


"Phil Rushton" <phil.rushton (AT) age-concern-cardiff (DOT) org.uk> wrote

Quote:
Is there a way to program the filter by form view so I can customise it?

Phil

Reply With Quote
  #6  
Old   
imb
 
Posts: n/a

Default Re: Filter by Form - 02-23-2011 , 07:59 AM



Hi,

For that purpose I use an unbound “Selection_form”, that is populated
with the fieldnames. The user can fill in the appropriate selection
values for the fields.
After hitting the OK-button a query-string or a filter-string is
constructed on the basis of the filled-in values.

Because I work with generalized forms and meta-data, this one
“Selection_form” in a reference database is automatically build in in
any continuous form in any database application based on this
principle.


Imb.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.