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 Programming / May 2005

Tip: Looking for answers? Try searching our database.

No Records on Listbox - Controlled by Combo Box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jen Preston - 03 May 2005 23:33 GMT
I need my list box to populate with records belonging to my combo drop
down.  The drop down is based on companyid.  My code is not working.  The
list box is always blank.  Here's my code:

Private Sub Combo170_AfterUpdate()
      Dim rs As Object

   Set rs = Me.Recordset.Clone
   rs.FindFirst "[Companyid] = " & Str(Nz(Me![Combo170], 0))
   If Not rs.EOF Then Me.Bookmark = rs.Bookmark
   
   Dim sFilter As String
      sFilter = [CompanyName]
           
   Me!Label90.Caption = sFilter
   Me!List195.RowSource = [Companyid]
   
End Sub

In my query of the "list195" I have the following on companyid:
[Forms]![frmEdit]![Combo170]
Rob Parker - 04 May 2005 02:26 GMT
If your existing query for the list-box's rowsource is returning the records
you want, filtered by the value of your combo-box (run the query
separately - with the form open and a selection in the combo-box - to
confirm this), then all you need is:

   Me!List195.Requery

HTH,

Rob

> I need my list box to populate with records belonging to my combo drop
> down.  The drop down is based on companyid.  My code is not working.  The
[quoted text clipped - 17 lines]
> In my query of the "list195" I have the following on companyid:
> [Forms]![frmEdit]![Combo170]
Danielle Haile - 09 May 2005 17:26 GMT
The listbox is not returning only the fields selected in my combo box.
It's returning all records.
 
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.