Can't select any from Combo Box

B

Bunky

I have two combo boxes on a form. The first one shows the supervisor and the
second one shows just the employees that are assigned to that supervisor. I
see the employees just fine but when I try to select one, it always puts the
first one in the list as the one selected. I have done this type of thing
before using two combo boxes for other purposes and they work just fine.

Here is the code.
Combo17 - Row source = SELECT Staff.Specialist AS Super, Staff.Skill FROM
Staff WHERE (((Staff.Specialist) Not Like 'No, One') AND ((Staff.Skill)='SU')
AND ((Staff.Supervisor) Not Like 'Termed')) ORDER BY Staff.Specialist; this
was done by the query builder. Then in After update - I have and Event
Procedure as follows -

Private Sub Combo17_AfterUpdate()
Combo19 = Null
Combo19.Requery
Combo19 = Me.Combo19.ItemData(0)
End Sub

In the second combo box (Combo19) I am using the following code -
SELECT Staff.Supervisor, Staff.Specialist FROM Staff WHERE
(((Staff.Supervisor)=[Forms]![SurveyDriver]![Combo17])) ORDER BY
Staff.Specialist;

That's it! but it will not allow me to select any specialist!!?????

Thanks in advance for your assistance.
 
J

Jeanette Cunningham

Hi Bunky,

Things to check-->
--the combo is not bound
--the combo or the form have not become corrupted

Try creating a new quickie form with just the 2 combos and see if it works.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
B

Bunky

Hi Jeanette!

Thank you for the quick response!
I tried the quickie test and it did the same thing - However, you said to
check to see if the combo boxes were bound. They are not. What should they
be bound to? I am letting the SQL builder do the query I need. I am afraid I
do not understand.

Thanks

Jeanette Cunningham said:
Hi Bunky,

Things to check-->
--the combo is not bound
--the combo or the form have not become corrupted

Try creating a new quickie form with just the 2 combos and see if it works.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Bunky said:
I have two combo boxes on a form. The first one shows the supervisor and
the
second one shows just the employees that are assigned to that supervisor.
I
see the employees just fine but when I try to select one, it always puts
the
first one in the list as the one selected. I have done this type of thing
before using two combo boxes for other purposes and they work just fine.

Here is the code.
Combo17 - Row source = SELECT Staff.Specialist AS Super, Staff.Skill FROM
Staff WHERE (((Staff.Specialist) Not Like 'No, One') AND
((Staff.Skill)='SU')
AND ((Staff.Supervisor) Not Like 'Termed')) ORDER BY Staff.Specialist;
this
was done by the query builder. Then in After update - I have and Event
Procedure as follows -

Private Sub Combo17_AfterUpdate()
Combo19 = Null
Combo19.Requery
Combo19 = Me.Combo19.ItemData(0)
End Sub

In the second combo box (Combo19) I am using the following code -
SELECT Staff.Supervisor, Staff.Specialist FROM Staff WHERE
(((Staff.Supervisor)=[Forms]![SurveyDriver]![Combo17])) ORDER BY
Staff.Specialist;

That's it! but it will not allow me to select any specialist!!?????

Thanks in advance for your assistance.
 
B

Bunky

Hi Again!

I looked at another application where this same thing is being done and both
combo boxes are bound to the table being updated. In my application, I am
simply trying to use the combo boxes as an input on a form to drive a report.
Do I need to do a different type of box?

Jeanette Cunningham said:
Hi Bunky,

Things to check-->
--the combo is not bound
--the combo or the form have not become corrupted

Try creating a new quickie form with just the 2 combos and see if it works.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Bunky said:
I have two combo boxes on a form. The first one shows the supervisor and
the
second one shows just the employees that are assigned to that supervisor.
I
see the employees just fine but when I try to select one, it always puts
the
first one in the list as the one selected. I have done this type of thing
before using two combo boxes for other purposes and they work just fine.

Here is the code.
Combo17 - Row source = SELECT Staff.Specialist AS Super, Staff.Skill FROM
Staff WHERE (((Staff.Specialist) Not Like 'No, One') AND
((Staff.Skill)='SU')
AND ((Staff.Supervisor) Not Like 'Termed')) ORDER BY Staff.Specialist;
this
was done by the query builder. Then in After update - I have and Event
Procedure as follows -

Private Sub Combo17_AfterUpdate()
Combo19 = Null
Combo19.Requery
Combo19 = Me.Combo19.ItemData(0)
End Sub

In the second combo box (Combo19) I am using the following code -
SELECT Staff.Supervisor, Staff.Specialist FROM Staff WHERE
(((Staff.Supervisor)=[Forms]![SurveyDriver]![Combo17])) ORDER BY
Staff.Specialist;

That's it! but it will not allow me to select any specialist!!?????

Thanks in advance for your assistance.
 
J

Jeanette Cunningham

There must be something else on the form that is interferring.
Or maybe the tables and relationship setup is preventing this from working.
If you have any lookup fields in one of the table this may be the problem.
As we can't see your form, it's pretty much guesswork at this end.

Would you post the details of the tables for the form and the 2 combos.
--table names
--primary key
--foreign key
--relationship


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Bunky said:
Hi Again!

I looked at another application where this same thing is being done and
both
combo boxes are bound to the table being updated. In my application, I am
simply trying to use the combo boxes as an input on a form to drive a
report.
Do I need to do a different type of box?

Jeanette Cunningham said:
Hi Bunky,

Things to check-->
--the combo is not bound
--the combo or the form have not become corrupted

Try creating a new quickie form with just the 2 combos and see if it
works.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia


Bunky said:
I have two combo boxes on a form. The first one shows the supervisor
and
the
second one shows just the employees that are assigned to that
supervisor.
I
see the employees just fine but when I try to select one, it always
puts
the
first one in the list as the one selected. I have done this type of
thing
before using two combo boxes for other purposes and they work just
fine.

Here is the code.
Combo17 - Row source = SELECT Staff.Specialist AS Super, Staff.Skill
FROM
Staff WHERE (((Staff.Specialist) Not Like 'No, One') AND
((Staff.Skill)='SU')
AND ((Staff.Supervisor) Not Like 'Termed')) ORDER BY Staff.Specialist;
this
was done by the query builder. Then in After update - I have and Event
Procedure as follows -

Private Sub Combo17_AfterUpdate()
Combo19 = Null
Combo19.Requery
Combo19 = Me.Combo19.ItemData(0)
End Sub

In the second combo box (Combo19) I am using the following code -
SELECT Staff.Supervisor, Staff.Specialist FROM Staff WHERE
(((Staff.Supervisor)=[Forms]![SurveyDriver]![Combo17])) ORDER BY
Staff.Specialist;

That's it! but it will not allow me to select any specialist!!?????

Thanks in advance for your assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top