Strange CboBox Problem

  • Thread starter Thread starter Anthony Viscomi
  • Start date Start date
A

Anthony Viscomi

I have a cbo box within a subForm; its control source is bound to a field
within the underlying table. The row source is as follows:

SELECT tblCourses.LocationCode, dbo_location.l_desc FROM dbo_location INNER
JOIN tblCourses ON dbo_location.l_code=tblCourses.LocationCode WHERE
(((tblCourses.CourseCode)=Forms![frmStudent(Main)]![dbo_course
subform].Form!c_code)) GROUP BY tblCourses.LocationCode, dbo_location.l_desc
ORDER BY tblCourses.LocationCode;

My problem is that when the user views the values within the above mentioned
cboBox it contains the values for the previous record. Here's the strange
part; when I view the Row Source properties for the cboBox and click on the
"..." to see the underlying query and then return the cboBox the correct
values then appear.

Please help, I actually have the same issue with all of the cboBoxes on this
form.

Thanks!
Anthony
 
when your combo box's RowSource includes a value in the current record
(either the mainform record, or subform record) as part of its' criteria,
you need to requery the combo box in the form's OnCurrent event - whichever
form has the value you're filtering with. then every time you move to a
different record, the combobox is requeried using the correct criteria
value.

hth
 
Thanks, actually I had read another posting that you had responed to that
was similiar to mine. Thanks again!
tina said:
when your combo box's RowSource includes a value in the current record
(either the mainform record, or subform record) as part of its' criteria,
you need to requery the combo box in the form's OnCurrent event -
whichever
form has the value you're filtering with. then every time you move to a
different record, the combobox is requeried using the correct criteria
value.

hth


Anthony Viscomi said:
I have a cbo box within a subForm; its control source is bound to a field
within the underlying table. The row source is as follows:

SELECT tblCourses.LocationCode, dbo_location.l_desc FROM dbo_location INNER
JOIN tblCourses ON dbo_location.l_code=tblCourses.LocationCode WHERE
(((tblCourses.CourseCode)=Forms![frmStudent(Main)]![dbo_course
subform].Form!c_code)) GROUP BY tblCourses.LocationCode, dbo_location.l_desc
ORDER BY tblCourses.LocationCode;

My problem is that when the user views the values within the above mentioned
cboBox it contains the values for the previous record. Here's the strange
part; when I view the Row Source properties for the cboBox and click on the
"..." to see the underlying query and then return the cboBox the correct
values then appear.

Please help, I actually have the same issue with all of the cboBoxes on this
form.

Thanks!
Anthony
 
Back
Top