cascading combos

  • Thread starter Thread starter Sue R via AccessMonster.com
  • Start date Start date
S

Sue R via AccessMonster.com

I've read through and tried numerous ideas posted here and other sites for
Cascading combos but still must be doing something wrong so any help is
appreciated.

I have a simple database with 2 tables
tblMain ( all employee fields)
tbl Unit (Department, Unit)

this is my latest attempt from postings I've found -

I have a form (frmEmployeeInfo) with two combo boxes.
cbxDepartment
Row Source Type - Table/Query
Row Source - SELECT DISTINCT tblUnit.Department FROM tblUnit ORDER BY tblUnit.
Department;
Column Count - 1
Bound column - 2
After Update - Private Sub cbxDepartment_AfterUpdate()
On Error Resume Next
cbxUnit.RowSource = "Select tblUnit.Unit " & _
"FROM tblUnit " & _
"WHERE tblUnit.Department = '" & cbxDepartment.Value & "' " & _
"ORDER BY tblUnit.Unit;"
End Sub

cbxUnit
Row Source Type - Table/Query
Row Source -
Column Count - 1
Bound Column - 1
After Update - none

Thank you for any help, it is greatly appreciated.
Sue
 
Sue

You have the bound column fo rthe department set to 2. It should be 1. You
only have one field in the rowsource.
 
I had tried switching that ...I tried again and it allows one of the
department names to show up in the combo box but nothing in the drop down.

Sue

Bill said:
Sue

You have the bound column fo rthe department set to 2. It should be 1. You
only have one field in the rowsource.
I've read through and tried numerous ideas posted here and other sites for
Cascading combos but still must be doing something wrong so any help is
[quoted text clipped - 30 lines]
Thank you for any help, it is greatly appreciated.
Sue
 
Your rowsource looks right. And the bound column HAS to be 1 because you have
only one field in the rowsource query.

How many distinct Departments are in tblUnit?


--
Bill Mosca, Microsoft Access MVP


Sue R via AccessMonster.com said:
I had tried switching that ...I tried again and it allows one of the
department names to show up in the combo box but nothing in the drop down.

Sue

Bill said:
Sue

You have the bound column fo rthe department set to 2. It should be 1. You
only have one field in the rowsource.
I've read through and tried numerous ideas posted here and other sites for
Cascading combos but still must be doing something wrong so any help is
[quoted text clipped - 30 lines]
Thank you for any help, it is greatly appreciated.
Sue
 
there are 13 different departments listed in the table with 59 records. The
one that does show up is somewhere in the middle. Column 1 - Department,
Column 2 - Unit, I also have a Column 3 - Department ID that I'm not using
for anything anymore but had added to try to get things working using ID's
based on another table instead.

Thanks
Sue

Bill said:
Your rowsource looks right. And the bound column HAS to be 1 because you have
only one field in the rowsource query.

How many distinct Departments are in tblUnit?
I had tried switching that ...I tried again and it allows one of the
department names to show up in the combo box but nothing in the drop down.
[quoted text clipped - 10 lines]
 
This is strange. The SQL you posted should show each department if you have
teh bound column set to 1.

What happens if you run the rowsource as a query? Do you get the expected
results?
--
Bill Mosca, Microsoft Access MVP


Sue R via AccessMonster.com said:
there are 13 different departments listed in the table with 59 records. The
one that does show up is somewhere in the middle. Column 1 - Department,
Column 2 - Unit, I also have a Column 3 - Department ID that I'm not using
for anything anymore but had added to try to get things working using ID's
based on another table instead.

Thanks
Sue

Bill said:
Your rowsource looks right. And the bound column HAS to be 1 because you have
only one field in the rowsource query.

How many distinct Departments are in tblUnit?
I had tried switching that ...I tried again and it allows one of the
department names to show up in the combo box but nothing in the drop down.
[quoted text clipped - 10 lines]
Thank you for any help, it is greatly appreciated.
Sue
 
Still doesn't work...maybe something wrong with my relationship setup?...can
you tell me how I should have them set?

Thanks
Sue

Bill said:
This is strange. The SQL you posted should show each department if you have
teh bound column set to 1.

What happens if you run the rowsource as a query? Do you get the expected
results?
there are 13 different departments listed in the table with 59 records. The
one that does show up is somewhere in the middle. Column 1 - Department,
[quoted text clipped - 15 lines]
 
Are you saying th equery is not working when you run it in the query window?

This has nothing to do with relationships since you are using only one table.

Would it be possible to send me a zipped sample db that contains your form
and the table? My email address is wrmosca at myself dot com

--
Bill Mosca, Microsoft Access MVP


Sue R via AccessMonster.com said:
Still doesn't work...maybe something wrong with my relationship setup?...can
you tell me how I should have them set?

Thanks
Sue

Bill said:
This is strange. The SQL you posted should show each department if you have
teh bound column set to 1.

What happens if you run the rowsource as a query? Do you get the expected
results?
there are 13 different departments listed in the table with 59 records. The
one that does show up is somewhere in the middle. Column 1 - Department,
[quoted text clipped - 15 lines]
Thank you for any help, it is greatly appreciated.
Sue
 
I found your problem right away. You had set the column widths so that the
first column was 0â€. That hides it. I corrected the column widths and all
appears to be working.


--
Bill Mosca, Microsoft Access MVP


Sue R via AccessMonster.com said:
Still doesn't work...maybe something wrong with my relationship setup?...can
you tell me how I should have them set?

Thanks
Sue

Bill said:
This is strange. The SQL you posted should show each department if you have
teh bound column set to 1.

What happens if you run the rowsource as a query? Do you get the expected
results?
there are 13 different departments listed in the table with 59 records. The
one that does show up is somewhere in the middle. Column 1 - Department,
[quoted text clipped - 15 lines]
Thank you for any help, it is greatly appreciated.
Sue
 
You are my HERO! I am so grateful - Thank you :)))

Bill said:
I found your problem right away. You had set the column widths so that the
first column was 0â€. That hides it. I corrected the column widths and all
appears to be working.
Still doesn't work...maybe something wrong with my relationship setup?...can
you tell me how I should have them set?
[quoted text clipped - 12 lines]
 
My pleasure, Sue.


--
Bill Mosca, Microsoft Access MVP


Sue R via AccessMonster.com said:
You are my HERO! I am so grateful - Thank you :)))

Bill said:
I found your problem right away. You had set the column widths so that the
first column was 0â€. That hides it. I corrected the column widths and all
appears to be working.
Still doesn't work...maybe something wrong with my relationship setup?...can
you tell me how I should have them set?
[quoted text clipped - 12 lines]
Thank you for any help, it is greatly appreciated.
Sue
 
Back
Top