limiting combo box values based on another field

lscheer

Registered User.
Local time
Today, 01:21
Joined
Jan 20, 2000
Messages
185
I have read several posts on this forum about limiting or adjusting the values in a combo box based on a selection from another combo box. I figured the same logic would work if I wanted to set my limits based on the value in a text box field, but I can't get it to work.

What I have is a record for training applicants that is a one-to-many relationship with the trainings attended and also a one-to-many relationship for trainings invoiced (trainings invoiced IS a different dataset than those attended, since most of them are free, so that's why they're different relationships). These are also part of one-to-many relationships from a TrainingInfo table that provides the info about the training course.

Basically, if a person cancels their spot in a training, they get invoiced. In the trainings invoiced table, I have the ApplID field (foreign key from Applicants table) and the TrgID field (foreign key from the TrainingInfo table). The ApplID is the linked field for the subforms, so it is updated automatically, but I was wanting to do is have the TrgID field combo box limited to only the TrgID values where an applicant could be invoiced (i.e. "cancelled")

So I set the TrgID field on the subform to a query with the "cancelled" criteria established and the ApplID field = frmApplicants.ApplID, and requeried the form on ApplID after update. It doesn't seem to work. I get prompted for the parameter Forms!frmApplicants!ApplID every time I open the form, and then the combo box list is blank.

Any ideas or suggestions?
 
Replace the parameter Forms!frmApplicants!ApplID with a known value and see if you get a listing...
 
Yes, that works, and it works if I type the ID number into the parameter dialog box. What I was hoping to accomplish, however, is that the ID field value would be detected automatically and used as a criteria for the underlying query instead of having my basic users have to find and type in the number.
 

Users who are viewing this thread

Back
Top Bottom