How to make a drop down box to select a person and display results (1 Viewer)

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
I have a query that had a thing some information and the person responcible for it. kind of like this

12341201 Sam
14525166 Ian
15648463 Ian
14584853 Bob
56646466 Sam
89414672 Bob
54668469 Bob

Well what I need to be able to do is make a drop down box with each name in it and when I select that name all of the things that they are responcible for will show up.

There is also some that have no one being responcible for and in that case I would just like to be able to see the ones with no one responcible for them.

Any help would be appreciated.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:45
Joined
Feb 12, 2007
Messages
3,015
use the wizard to make your combo box
 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
use the wizard to make your combo box

I did but when I try to change the name it shows all of the things and not just the ones the people are responcible for.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:45
Joined
Feb 12, 2007
Messages
3,015
k then your query should return only the responsibilites. use the combobox as criteria for your query
 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
Can you please clarify that that makes no sense whatsoever to me.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:45
Joined
Feb 12, 2007
Messages
3,015
can you post a sample of your db? i realize that my explanations are the most clear today. it is monday after all.
if you post your db ill show you want i am talking about.
 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
can you post a sample of your db? i realize that my explanations are the most clear today. it is monday after all.
if you post your db ill show you want i am talking about.

I cant post the database because it has sensitive information in it but I can try and do a better job of explaining what I have. I am trying to keep tracks of certain things. they have dates and lenghts associated with them as well as a person who is responcible for them. What I am trying to do is weed out some problemed things for the people responcible for them to correct information. So what I need is a form that displays the results of lets call it a changes query. so there are like 8 different possible people who are responcible for these things and there are some additional information there.

What I have in my query like I said is the thing, dates, lengths and of course the person whos responcible for that thing.

What I need to do next is try and make a form of some type where the people responcible can select there name and then all the problem things will show up.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:45
Joined
Feb 12, 2007
Messages
3,015
k. make an unbound form with a combo box on it. next make a subform based on the changes criteria.

in your queries criteria put forms!formname.comboboxname. <-change the formname and combobox name accordingly.

Place a button on the mainform that does a me.subformcontainername.requery

that should do it for u. I can make an example for you if need be
 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
k. make an unbound form with a combo box on it. next make a subform based on the changes criteria.

in your queries criteria put forms!formname.comboboxname. <-change the formname and combobox name accordingly.

Place a button on the mainform that does a me.subformcontainername.requery

that should do it for u. I can make an example for you if need be

Ok that worked pretty well the only thing is it will not show me a list of the 10 or so people responcible for them but I have to instead enter a name in Enter Parameter Value box.

Also could you give me a bit better explanation of the part in bold.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:45
Joined
Feb 12, 2007
Messages
3,015
forms!formname.comboboxname if you change this to match your formname and your combobox name it will not ask for you to enter it in.

The part in bold is how you will get the results to requery in the subform based on the persons name in the combo box. you could also put this in the afterupdate event of the combo box if you do not want to have to use a button.
 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
forms!formname.comboboxname if you change this to match your formname and your combobox name it will not ask for you to enter it in.

The part in bold is how you will get the results to requery in the subform based on the persons name in the combo box. you could also put this in the afterupdate event of the combo box if you do not want to have to use a button.


ok where do I need to put the forms statement in at again.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:45
Joined
Feb 12, 2007
Messages
3,015
in the criteria for your query under person name
 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
what is the me. for in that part. I think Im really close to having this to work.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:45
Joined
Feb 12, 2007
Messages
3,015
me refers to the active form/control
 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
I am getting an error saying can not find the macro me.
 

rainman89

I cant find the any key..
Local time
Yesterday, 19:45
Joined
Feb 12, 2007
Messages
3,015
you are putting it in an event procedure correct? not just in the event itself?
 

boblarson

Smeghead
Local time
Yesterday, 16:45
Joined
Jan 12, 2001
Messages
32,059
you are putting it in an event procedure correct? not just in the event itself?

Just a pictorial of what Ray is talking about (the sample was created for someone else, but the procedure is the same, even if it isn't the same event:







 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
a picture is worth a thousand words thanks for the help got it to work ok.

Thanks
 

jason2885

Registered User.
Local time
Yesterday, 16:45
Joined
Jun 18, 2007
Messages
99
Ok I have another problem with this.

It will not show all of the peoples names in the combo box.

What I need to have happen is for there each name of the potential people to appear in the combo box and then be able to select one of them and then display the things that that person is responcible for and the information to go along with it. I have it working but I have to type the persons name in and I want to be able to just use a drop down box with the names in it.
 

Users who are viewing this thread

Top Bottom