Strange CboBox Problem

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
 
T

tina

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
 
A

Anthony Viscomi

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top