Parameter in Combo box (1 Viewer)

Full_Williams

Registered User.
Local time
Today, 04:18
Joined
Jul 2, 2002
Messages
88
Hi there,

I have a subform that I'm using and on it I have a combo box (cmbAgencyID) where I select an agency. So what I want to be able to do is select an employee based on the agency chosen in another combo box (cmbEmployee). So each agency has a say 5-6 employees working for them.

I've pointed the cmbEmployee to look at the agency chosen, but for some reason the employees are not showing up in the cmbEmployee. I've included the subform in the Parameters ([forms]![frmMain]![frmSub].[form]![cmbAgencyID]), but this isn't working.

Any thoughts on how I could get this to work would be appreciated.

Thanks,
Full Williams
 

Adrianna

Registered User.
Local time
Yesterday, 23:18
Joined
Oct 16, 2000
Messages
254
Hi Neighbor. I'm not really sure why you're having the problem. It seems pretty simple. Have you thought about placing a Refresh command to the OnChange Event of the first combo box.

From what I understand you allow the user to make a selection from the first combobox, then your query runs on cmbAgencyID and cmbEmployee, only making cmbEmployee.visible

WHERE(in the Criteria line...leaving off WHERE) cmbAgencyID = Forms!frmMain!cmbAgencyID

Assuming that your list box for cmbAgencyID is named cmbAgencyID and not List#

If you've tried exactly that.....and it's still not working you can always post a small zip of the database and someone (if I don't get to it first) will try to fix it and post it back!
 

Alexandre

Registered User.
Local time
Today, 10:18
Joined
Feb 22, 2001
Messages
794
Plus, if you want combos to keep synchro when the user switches between records, you will have to refresh combo2 also from the OnCurrent event of your form
 

Full_Williams

Registered User.
Local time
Today, 04:18
Joined
Jul 2, 2002
Messages
88
Thanks for the quick replys.

The refresh OnChange event worked fine as far as only being able to select employees that work for the Agency selected. Now I'm having a problem with all the Employees changing depending on the Agency selected. I probably should have mentioned this earlier, but my subform is a continuous form and I want to be able to change the Agency and then reselect an employee for one record if necessary without the employees for the other records changing.

I hope this makes sense. Please let me know if you need anymore info.

Thanks,
Full Williams
 

Adrianna

Registered User.
Local time
Yesterday, 23:18
Joined
Oct 16, 2000
Messages
254
Sounds like a relationship issue.

If you're using the Agency combo box to determine the Employees in the List box...then you're creating a restriction based on the relationship of the two items in a single record. If you want to be able to Select an employee and attach then to a new agency, you'll have to use an additional textbox bound to the employee's agency. You can make the chance there...and then on update or change, have it refresh so that the single emplyee will not fall under a new agency.

I don't know if I understood you correctly. I guess without seeing what you're trying to do and how your tables are set up...I've just got to go off of the description and make assumptions. :rolleyes: Which leaves room for a lot of misunderstanding and errors.
 

Full_Williams

Registered User.
Local time
Today, 04:18
Joined
Jul 2, 2002
Messages
88
Adrianna,

Thanks for your help. I think you're right about the relationships. I haven't solved it yet, but it this feature wasn't asked and I'm falling a bit behind on the project so it's going to have to wait until the end if I have time.

Thanks for helping me though.

Take care,
Full Williams
 

Users who are viewing this thread

Top Bottom