Synchronize two combo boxes on a form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Sql 2000 and Access 2003. I'm using the code below that's from
Article ID 289670.

Me.Department.RowSource = "SELECT Departments FROM" & _
" Department WHERE BranchId = " & Me.Branch & _
" ORDER BY Departments"

Me.Department = Me.Department.ItemData(0)

I got the code to work but I had to copy and rename my tables to Department
and Branch. My original tables were named with tbl. My combo boxes were named
with cbo but I had to rename them.

I've tried everything to get the code to work with the tbl and cbo but
nothing works.

It would be too much work to have to go through the entire db and make
everything work using the Department and Branch tables.

How can I get the code to work using tblDepartment, tblBranch, cboBranch and
cboDepartment ?

Thanks,

Paul
 
It should work using *your* names. Tell us what happens when you use your
names?
 
When I use the tbl and cbo prefixes and select a Branch the Department cbo is
empty. The Department Row Source has the following:

SELECT Departments FROM Department WHERE BranchId = 4 ORDER BY Departments
 
Me.cboDepartment.RowSource = "SELECT Departments FROM" & _
" tblDepartment WHERE BranchId = " & Me.cboBranch & _
" ORDER BY Departments
 
That worked. The code was a little hard to figure out since the tables and
combo boxes were named the name in the NorthWinds db.

Thanks for the help,

Paul
 
Back
Top