L
Laurel
I have a form with a combo box whose row source is as follows.
SELECT DISTINCT tblAcademics.Description, tblAcademics.Sequence FROM
tblAcademics, tblStudents WHERE
(((tblAcademics.Student_id)=[tblStudents].[Student_id]) AND
((tblAcademics.Assessment_Date)=[txtGrade_Date]) AND
((tblStudents.Class_Code)=[cboClass_Code]) AND
((tblAcademics.Subject)=[cboSubject]) AND ((tblAcademics.Type)=[cboType]))
UNION select "New" as NewChoice, 100 as NewSequence from tblAcademics ORDER
BY tblAcademics.Sequence;
Whenever this retrieves a result set where the first row has an empty string
("") in the tblAcademics.Description column (as verified by executing the
rowsource SQL in as a query, bot cboDescAndSeq.Column(0) and
cboDescAndSeq.Column(1) are null, and the script blows up when
is_PreviousDescription is set to txtDescription. txtDescription and
txtSequence are text boxes. Note that in those cases where Description is
an empty string, Sequence is always 1 or 2. There are no rows in
tblAcademics where Description is null. There are no rows in tblAcademics
where Sequence is null. The code works fine when there is data in the
description column. Any ideas?
ls_debug = cboDescAndSeq.RowSource
cboDescAndSeq.Requery
cboDescAndSeq = cboDescAndSeq.ItemData(0)
txtDescription = cboDescAndSeq.Column(0)
txtSequence = cboDescAndSeq.Column(1)
is_PreviousDescription = txtDescription
ii_PreviousSequence = txtSequence
SELECT DISTINCT tblAcademics.Description, tblAcademics.Sequence FROM
tblAcademics, tblStudents WHERE
(((tblAcademics.Student_id)=[tblStudents].[Student_id]) AND
((tblAcademics.Assessment_Date)=[txtGrade_Date]) AND
((tblStudents.Class_Code)=[cboClass_Code]) AND
((tblAcademics.Subject)=[cboSubject]) AND ((tblAcademics.Type)=[cboType]))
UNION select "New" as NewChoice, 100 as NewSequence from tblAcademics ORDER
BY tblAcademics.Sequence;
Whenever this retrieves a result set where the first row has an empty string
("") in the tblAcademics.Description column (as verified by executing the
rowsource SQL in as a query, bot cboDescAndSeq.Column(0) and
cboDescAndSeq.Column(1) are null, and the script blows up when
is_PreviousDescription is set to txtDescription. txtDescription and
txtSequence are text boxes. Note that in those cases where Description is
an empty string, Sequence is always 1 or 2. There are no rows in
tblAcademics where Description is null. There are no rows in tblAcademics
where Sequence is null. The code works fine when there is data in the
description column. Any ideas?
ls_debug = cboDescAndSeq.RowSource
cboDescAndSeq.Requery
cboDescAndSeq = cboDescAndSeq.ItemData(0)
txtDescription = cboDescAndSeq.Column(0)
txtSequence = cboDescAndSeq.Column(1)
is_PreviousDescription = txtDescription
ii_PreviousSequence = txtSequence