Combo Box/List relationship

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

Guest

i want to create a form with two combo/list boxes.

The first one will select a particular office, the second will depend on the
first and will show the employees for that office ONLY!

At the moment i can only get it to show all employees

Thanks
 
The classic cascading combo is easy to do but it depends on how you have
entered your info. Going with two tables (one for department and one for
staff)

Make the first combo based on your department list.

For the second combo you need to create a query using staff and department.
In the criteria row for department put in the name for the first combo like:

[forms]![form name]![combo1]

In the properties for the second combo go to the "data" tab. There are two
options.

Row source type: choose "table/query"
Row source: choose the query.
bound column: 1

In the format tab

column count: 2
column widths: 5cm;0cm


In the "after update" event of the first combo type:

combo1.requery
combo2 = null

You should then list all staff for the chosen department

Let me know!
 
Hi


Its working...almost!

WHen i open it at first ot works but if try to change the office it get an
error message

"
Access cant find the macro "comboname"
macro doesnt exist or ahs not been save..........."

I think it has to do with the afterupdate part
scubadiver said:
The classic cascading combo is easy to do but it depends on how you have
entered your info. Going with two tables (one for department and one for
staff)

Make the first combo based on your department list.

For the second combo you need to create a query using staff and department.
In the criteria row for department put in the name for the first combo like:

[forms]![form name]![combo1]

In the properties for the second combo go to the "data" tab. There are two
options.

Row source type: choose "table/query"
Row source: choose the query.
bound column: 1

In the format tab

column count: 2
column widths: 5cm;0cm


In the "after update" event of the first combo type:

combo1.requery
combo2 = null

You should then list all staff for the chosen department

Let me know!

--
www.ae911truth.org



SGTPEP said:
i want to create a form with two combo/list boxes.

The first one will select a particular office, the second will depend on the
first and will show the employees for that office ONLY!

At the moment i can only get it to show all employees

Thanks
 
You don't need a macro

--
www.ae911truth.org



SGTPEP said:
Hi


Its working...almost!

WHen i open it at first ot works but if try to change the office it get an
error message

"
Access cant find the macro "comboname"
macro doesnt exist or ahs not been save..........."

I think it has to do with the afterupdate part
scubadiver said:
The classic cascading combo is easy to do but it depends on how you have
entered your info. Going with two tables (one for department and one for
staff)

Make the first combo based on your department list.

For the second combo you need to create a query using staff and department.
In the criteria row for department put in the name for the first combo like:

[forms]![form name]![combo1]

In the properties for the second combo go to the "data" tab. There are two
options.

Row source type: choose "table/query"
Row source: choose the query.
bound column: 1

In the format tab

column count: 2
column widths: 5cm;0cm


In the "after update" event of the first combo type:

combo1.requery
combo2 = null

You should then list all staff for the chosen department

Let me know!

--
www.ae911truth.org



SGTPEP said:
i want to create a form with two combo/list boxes.

The first one will select a particular office, the second will depend on the
first and will show the employees for that office ONLY!

At the moment i can only get it to show all employees

Thanks
 
I know

I dont have a macro.

I managed to stop it from happening, however when i select another office i
can still only select the employees from the first office selected.

In the afterupdate section, do i simply type in " combo1.requery combo2=Null"

or do i bulid an expression?

scubadiver said:
You don't need a macro

--
www.ae911truth.org



SGTPEP said:
Hi


Its working...almost!

WHen i open it at first ot works but if try to change the office it get an
error message

"
Access cant find the macro "comboname"
macro doesnt exist or ahs not been save..........."

I think it has to do with the afterupdate part
scubadiver said:
The classic cascading combo is easy to do but it depends on how you have
entered your info. Going with two tables (one for department and one for
staff)

Make the first combo based on your department list.

For the second combo you need to create a query using staff and department.
In the criteria row for department put in the name for the first combo like:

[forms]![form name]![combo1]

In the properties for the second combo go to the "data" tab. There are two
options.

Row source type: choose "table/query"
Row source: choose the query.
bound column: 1

In the format tab

column count: 2
column widths: 5cm;0cm


In the "after update" event of the first combo type:

combo1.requery
combo2 = null

You should then list all staff for the chosen department

Let me know!

--
www.ae911truth.org



:

i want to create a form with two combo/list boxes.

The first one will select a particular office, the second will depend on the
first and will show the employees for that office ONLY!

At the moment i can only get it to show all employees

Thanks
 
"combo1" is the name of your first combo and "combo2" is the name of your
second combo. Replace them with the names you have given them.

--
www.ae911truth.org



SGTPEP said:
I know

I dont have a macro.

I managed to stop it from happening, however when i select another office i
can still only select the employees from the first office selected.

In the afterupdate section, do i simply type in " combo1.requery combo2=Null"

or do i bulid an expression?

scubadiver said:
You don't need a macro

--
www.ae911truth.org



SGTPEP said:
Hi


Its working...almost!

WHen i open it at first ot works but if try to change the office it get an
error message

"
Access cant find the macro "comboname"
macro doesnt exist or ahs not been save..........."

I think it has to do with the afterupdate part
:


The classic cascading combo is easy to do but it depends on how you have
entered your info. Going with two tables (one for department and one for
staff)

Make the first combo based on your department list.

For the second combo you need to create a query using staff and department.
In the criteria row for department put in the name for the first combo like:

[forms]![form name]![combo1]

In the properties for the second combo go to the "data" tab. There are two
options.

Row source type: choose "table/query"
Row source: choose the query.
bound column: 1

In the format tab

column count: 2
column widths: 5cm;0cm


In the "after update" event of the first combo type:

combo1.requery
combo2 = null

You should then list all staff for the chosen department

Let me know!

--
www.ae911truth.org



:

i want to create a form with two combo/list boxes.

The first one will select a particular office, the second will depend on the
first and will show the employees for that office ONLY!

At the moment i can only get it to show all employees

Thanks
 
I have done this!

The employee combo box will not update from the original office

scubadiver said:
"combo1" is the name of your first combo and "combo2" is the name of your
second combo. Replace them with the names you have given them.

--
www.ae911truth.org



SGTPEP said:
I know

I dont have a macro.

I managed to stop it from happening, however when i select another office i
can still only select the employees from the first office selected.

In the afterupdate section, do i simply type in " combo1.requery combo2=Null"

or do i bulid an expression?

scubadiver said:
You don't need a macro

--
www.ae911truth.org



:

Hi


Its working...almost!

WHen i open it at first ot works but if try to change the office it get an
error message

"
Access cant find the macro "comboname"
macro doesnt exist or ahs not been save..........."

I think it has to do with the afterupdate part
:


The classic cascading combo is easy to do but it depends on how you have
entered your info. Going with two tables (one for department and one for
staff)

Make the first combo based on your department list.

For the second combo you need to create a query using staff and department.
In the criteria row for department put in the name for the first combo like:

[forms]![form name]![combo1]

In the properties for the second combo go to the "data" tab. There are two
options.

Row source type: choose "table/query"
Row source: choose the query.
bound column: 1

In the format tab

column count: 2
column widths: 5cm;0cm


In the "after update" event of the first combo type:

combo1.requery
combo2 = null

You should then list all staff for the chosen department

Let me know!

--
www.ae911truth.org



:

i want to create a form with two combo/list boxes.

The first one will select a particular office, the second will depend on the
first and will show the employees for that office ONLY!

At the moment i can only get it to show all employees

Thanks
 
A mistake of mine. Try this in the afterupdate event.

combo2 = Null
combo2.Requery

let me know.
 
Something tells me you are typing that directly in the property cell.

Click on the build button to the right (...) and choose Code Builder.

NameofCombo2.Requery

--
Joan Wild
Microsoft Access MVP
SGTPEP said:
I have done this!

The employee combo box will not update from the original office

scubadiver said:
"combo1" is the name of your first combo and "combo2" is the name of your
second combo. Replace them with the names you have given them.

--
www.ae911truth.org



SGTPEP said:
I know

I dont have a macro.

I managed to stop it from happening, however when i select another office i
can still only select the employees from the first office selected.

In the afterupdate section, do i simply type in " combo1.requery combo2=Null"

or do i bulid an expression?

:



You don't need a macro

--
www.ae911truth.org



:

Hi


Its working...almost!

WHen i open it at first ot works but if try to change the office it get an
error message

"
Access cant find the macro "comboname"
macro doesnt exist or ahs not been save..........."

I think it has to do with the afterupdate part
:


The classic cascading combo is easy to do but it depends on how you have
entered your info. Going with two tables (one for department and one for
staff)

Make the first combo based on your department list.

For the second combo you need to create a query using staff and department.
In the criteria row for department put in the name for the first combo like:

[forms]![form name]![combo1]

In the properties for the second combo go to the "data" tab. There are two
options.

Row source type: choose "table/query"
Row source: choose the query.
bound column: 1

In the format tab

column count: 2
column widths: 5cm;0cm


In the "after update" event of the first combo type:

combo1.requery
combo2 = null

You should then list all staff for the chosen department

Let me know!

--
www.ae911truth.org



:

i want to create a form with two combo/list boxes.

The first one will select a particular office, the second will depend on the
first and will show the employees for that office ONLY!

At the moment i can only get it to show all employees

Thanks
 
Back
Top