Getting data from one combo box and creating recordsource in 2nd combo box 
Author Message
 Getting data from one combo box and creating recordsource in 2nd combo box

I am having a problem getting my form to work properly.  I have a combo box
that lists several years (1991, 1992, 1993, etc).  After someone selects the
year from that combo box, I would like a 2nd combo box's record source to be
created based on the year selected in first combo box.  (Select employees
from table whose hire_date = the year selected in first combo box).

From there, I then want to select the employee from 2nd combo box and look
up his or her record.

Can anyone help?

--
Lynda Kinley
Sr. Associate Director of Admissions
University of Maine at Farmington
207-778-7056



Sun, 18 Jul 2004 02:51:13 GMT  
 Getting data from one combo box and creating recordsource in 2nd combo box
Just a suggestion.  I would use a parameter queries to
open the form with the questions you want to answer.  To
do this make the parameter queries in the record source
for the form.  The first one would go in the criteria line
for the field that contains year data and would look like:
[Year(Please enter a year 1991,1992,1993,etch):]

Quote:
>-----Original Message-----
>I am having a problem getting my form to work properly.  
I have a combo box
>that lists several years (1991, 1992, 1993, etc).  After
someone selects the
>year from that combo box, I would like a 2nd combo box's
record source to be
>created based on the year selected in first combo box.  
(Select employees
>from table whose hire_date = the year selected in first
combo box).

>From there, I then want to select the employee from 2nd
combo box and look
>up his or her record.

>Can anyone help?

>--
>Lynda Kinley
>Sr. Associate Director of Admissions
>University of Maine at Farmington
>207-778-7056

>.



Sun, 18 Jul 2004 03:05:26 GMT  
 Getting data from one combo box and creating recordsource in 2nd combo box
For problem 1:
You need to set the record source of your 2nd combo box to
be an embeded query based on your employee table. Then use
the name of your 1st combo box as a criteria in the "year"
field of your embeded query. Make sure that the binding
field of your first combo is the "year" field. The
criteria in your embeded query should look like so:
[Forms]![YourEmployee_formName]![1stComboName]

Dont forget to program a procedure in the After Update
event of your 1st Combo box to Requery the 2nd one. In
that way, each time you select a year in the 1st Combo,
the second one will be requeried with the year you have
chosen.

For Problem 2
I am not sure but you might want to look in how to use
Bookmarks.

Xavier

Quote:
>-----Original Message-----
>I am having a problem getting my form to work properly.  
I have a combo box
>that lists several years (1991, 1992, 1993, etc).  After
someone selects the
>year from that combo box, I would like a 2nd combo box's
record source to be
>created based on the year selected in first combo box.  
(Select employees
>from table whose hire_date = the year selected in first
combo box).

>From there, I then want to select the employee from 2nd
combo box and look
>up his or her record.

>Can anyone help?

>--
>Lynda Kinley
>Sr. Associate Director of Admissions
>University of Maine at Farmington
>207-778-7056

>.



Sun, 18 Jul 2004 03:17:15 GMT  
 Getting data from one combo box and creating recordsource in 2nd combo box
I have tried what you suggested, but no data is appearing in the second
combo box.

I have also tried it by just having a parameter query when I open the form,
but this is not satisfactory because it forces you to close the form in
order to get another year.


Quote:
> For problem 1:
> You need to set the record source of your 2nd combo box to
> be an embeded query based on your employee table. Then use
> the name of your 1st combo box as a criteria in the "year"
> field of your embeded query. Make sure that the binding
> field of your first combo is the "year" field. The
> criteria in your embeded query should look like so:
> [Forms]![YourEmployee_formName]![1stComboName]

> Dont forget to program a procedure in the After Update
> event of your 1st Combo box to Requery the 2nd one. In
> that way, each time you select a year in the 1st Combo,
> the second one will be requeried with the year you have
> chosen.

> For Problem 2
> I am not sure but you might want to look in how to use
> Bookmarks.

> Xavier

> >-----Original Message-----
> >I am having a problem getting my form to work properly.
> I have a combo box
> >that lists several years (1991, 1992, 1993, etc).  After
> someone selects the
> >year from that combo box, I would like a 2nd combo box's
> record source to be
> >created based on the year selected in first combo box.
> (Select employees
> >from table whose hire_date = the year selected in first
> combo box).

> >From there, I then want to select the employee from 2nd
> combo box and look
> >up his or her record.

> >Can anyone help?

> >--
> >Lynda Kinley
> >Sr. Associate Director of Admissions
> >University of Maine at Farmington
> >207-778-7056

> >.



Sun, 18 Jul 2004 04:02:21 GMT  
 Getting data from one combo box and creating recordsource in 2nd combo box
I think that I have solved my problem.  I put a text box on the form and
made it equal to the selected item in the first combo box.  Then I changed
the record source of the second combo box to equal the text box.  Works
great!  I also made the text box invisible so that noone can see it on the
form.

Thanks for your help.

Quote:
> I have tried what you suggested, but no data is appearing in the second
> combo box.

> I have also tried it by just having a parameter query when I open the
form,
> but this is not satisfactory because it forces you to close the form in
> order to get another year.



> > For problem 1:
> > You need to set the record source of your 2nd combo box to
> > be an embeded query based on your employee table. Then use
> > the name of your 1st combo box as a criteria in the "year"
> > field of your embeded query. Make sure that the binding
> > field of your first combo is the "year" field. The
> > criteria in your embeded query should look like so:
> > [Forms]![YourEmployee_formName]![1stComboName]

> > Dont forget to program a procedure in the After Update
> > event of your 1st Combo box to Requery the 2nd one. In
> > that way, each time you select a year in the 1st Combo,
> > the second one will be requeried with the year you have
> > chosen.

> > For Problem 2
> > I am not sure but you might want to look in how to use
> > Bookmarks.

> > Xavier

> > >-----Original Message-----
> > >I am having a problem getting my form to work properly.
> > I have a combo box
> > >that lists several years (1991, 1992, 1993, etc).  After
> > someone selects the
> > >year from that combo box, I would like a 2nd combo box's
> > record source to be
> > >created based on the year selected in first combo box.
> > (Select employees
> > >from table whose hire_date = the year selected in first
> > combo box).

> > >From there, I then want to select the employee from 2nd
> > combo box and look
> > >up his or her record.

> > >Can anyone help?

> > >--
> > >Lynda Kinley
> > >Sr. Associate Director of Admissions
> > >University of Maine at Farmington
> > >207-778-7056

> > >.



Sun, 18 Jul 2004 04:29:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. using one combo box to break down the results in the 2nd combo box

2. Data of one combo box dependent on a 2nd one

3. Using Entry From Combo Box To Filter Entries In A 2nd Combo Box

4. combo box outcome in 2nd combo box

5. Requerying 2nd combo box after change to 1st combo box

6. Populate distinct one combo box depending on selection in another combo box

7. Creating a combo box that restricts another combo box

8. filtering combo box data by another combo box

9. How to make a combo box restrict data from another combo box

10. enter data in a combo box based on value from another combo box


 
Powered by phpBB® Forum Software © phpBB Group