Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2008

Tip: Looking for answers? Try searching our database.

Show only Filtered Records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DMH - 09 May 2008 21:19 GMT
Hello,

I have a form that displays records based on the value of a combo box.  How
can I display only the returned records?

Thanks
Golfinray - 09 May 2008 21:55 GMT
If you have your combo set up correctly it show only the desired or filtered
records. When you insert a combo (use the wizard) and allow the wizard to
select the field you want to filter on. Then in the properties of the combo
(not the label) go to events. In the afterupdate event start the code builder
and type:
Me.filter = "[yourfieldname] = """ & Me.combo# & """"
Me.filteron = True

> Hello,
>
> I have a form that displays records based on the value of a combo box.  How
> can I display only the returned records?
>
> Thanks
DMH - 12 May 2008 13:38 GMT
Thank you both very much for your replies.  The code you gave me works with
most of my combo boxes but this particular one uses a lookup field to find
the records.  Below is the existing code in the "after update" event. When I
add the code you gave me it gives me an error. Can either of you shed any
light on this for me?

Dim rs As Object

   Set rs = Me.Recordset.Clone
   rs.FindFirst "[OriginatorName] = " & Str(Nz(Me![Combo358], 0))
   If Not rs.EOF Then Me.Bookmark = rs.Bookmark
   

> If you have your combo set up correctly it show only the desired or filtered
> records. When you insert a combo (use the wizard) and allow the wizard to
[quoted text clipped - 10 lines]
> >
> > Thanks
Jason - 09 May 2008 21:59 GMT
fieldname_afterupdate
   filter = "FIELDNAME = """ &  FIELDNAME & """" for strings
   filter = "FIELDNAME = " &  FIELDNAME for numbers
> Hello,
>
> I have a form that displays records based on the value of a combo box.  How
> can I display only the returned records?
>
> Thanks
Jason - 09 May 2008 22:02 GMT
forgot filteron = true
to turn filtering off - filteron = false
> fieldname_afterupdate
>     filter = "FIELDNAME = """ &  FIELDNAME & """" for strings
[quoted text clipped - 6 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.