Thanks for the answers guys. Let me give you more detail as to how this is set up. I was a little tired last night and I didn't make any sense.
I have a combo box, cboDcSelect, it's rowsource is a query, qryDcAll. It has 4 columns, Grade, StudentName, StudentID, and DcViolationID.
ok...
The bound column is the 4th, Dress code violation ID, I use this to open 1 subform, subDcSelect. The record source is tblDcViolations. It opens the specific violation entered by the teacher.
Again: a combo box cannot and does not "open" a subform. You don't
need to open a subform; it's opened before the mainform opens, and
just gets populated with data. Are you using cboDCSelect as the Master
Link Field of the subform? or are you actually using code to open a
pop-up form (and calling it a "subform"?
If you just want to *display* the text of the violation, based on the
violation ID, you don't need a subform - instead use a textbox with a
control source like
=DLookUp("[Violation]", "tblDCViolations", "[DCViolationID] = " &
cboDCSelect
or (perhaps better) base the Combo box on a query on tblDCViolations,
selecting the ID but showing the name. The combo you now have will not
let you enter a new violation for a student, which I would guess is
what you want.
I have another subform, subDcPrevious, that is from the Violations, tblDcViolations. This subform is going to show all the violations that each student has. I want to use the student ID in the combo box to open this subform, but have not had any luck.
I tried to make the MasterLink field cboDcSelect.Column(2) and the ChildLink field StudentID, but I keep getting prompted to enter the value for cboDcSelect.Column(2) when the form opens.
In that case put a textbox txtStudentID on the form (it can be
invisible) and set its control source to
=cboDCSelect.Column(2)
and use txtStudentID as the Master Link Field.