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 / February 2007

Tip: Looking for answers? Try searching our database.

List box populated by dropdown selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam - 27 Feb 2007 20:03 GMT
Hey you all.

Here is the problem. I have drop down menu where I choose a employee role.
According to this role I would like to populate a list box. List box will get
the values from table where every record has role saved. So when I choose
"user" as a role from drop down menu, I want all the records which has "user"
as role to be shown in list box.

How can I do this?
Signature

-Sam

Al Campagna - 27 Feb 2007 21:51 GMT
Sam,
  Given example combo cboRole  and example listbox lstRoleRecordsThatMatch.
  In the query for the RowSource in lstRoleRecordsThatMatch use a criteria like this,
against the Role field...
       =Forms!YourFormName!cboRole
  Always Requery the lstRoleRecordsThatMatch on the AfterUpdate event of cboRole, so that
they always stay in synch, whenever you change cboRole.
Signature

hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

> Hey you all.
>
[quoted text clipped - 5 lines]
>
> How can I do this?
Al Campagna - 27 Feb 2007 21:53 GMT
Sam,
  If needed... on my website below, I have a sample file (A97 and A2003) called Synched
Combos which demonstrates the same principle with 2 combos.
Signature

hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

> Hey you all.
>
[quoted text clipped - 5 lines]
>
> How can I do this?
Sam - 28 Feb 2007 14:54 GMT
Hey thanks for the help. The example really makes sence. Still I cannot make
mine to work. Mine is slithly different. I'm using two tables, but I cannot
think of that making any difference. Here are the queries I'm using.

Combo box(name=role): SELECT roles.ID, roles.role FROM roles; //'role' is
visible

List box: SELECT projects.ID, projects.project_name FROM projects WHERE
projects.task_area=Forms!update_status_1!role;

Also behind combo box I have code on AfterUpdate event

Private Sub role_AfterUpdate()
   [Forms]![update_status_1]![List11] = Null
   [Forms]![update_status_1]![List11].Requery

End Sub

Signature

-Sam

> Sam,
>    If needed... on my website below, I have a sample file (A97 and A2003) called Synched
[quoted text clipped - 8 lines]
> >
> > How can I do this?
Sam - 28 Feb 2007 16:04 GMT
Hey, I figured it out. Works great now! Thank you for help Al.
Signature

-Sam

> Hey thanks for the help. The example really makes sence. Still I cannot make
> mine to work. Mine is slithly different. I'm using two tables, but I cannot
[quoted text clipped - 26 lines]
> > >
> > > How can I do this?
Al Campagna - 28 Feb 2007 19:11 GMT
Sam,
  Good deal... but Nulling the Combo2 before the Requery is not necessary... unless your
Nulling out Combo1.
  No big deal... gald you got it going.

Signature

hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions

"Find a job that you love, and you'll never work a day in your life."

> Hey, I figured it out. Works great now! Thank you for help Al.
>
[quoted text clipped - 29 lines]
>> > >
>> > > How can I do this?
 
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.