P
polman
I run into the following problem that I like to share with you and even
an reasonable explanation of it.
I have a combobox that its rowsource property is populated with the
following code Me!cboWhat1.RowSource = Me!cboWhere1.Column(3). That is
the 2nd column of another combobox which in fact is an SQL sentence
like: SELECT DISTINCT tblPatientRecord.BirthYear FROM tblPatientRecord;
or SELECT DISTINCT tblPatientRecord.LastName FROM tblPatientRecord; Let
say the first time I choose the second choice (LastName) and then I
choose the first choice (BirthYear). So far so good I' m happy with the
results.
BUT! when my first choice is the BirthYear (that is numeric of course)
and then I try to choose LastName (string) an error is produced that
the value is not accepted. (I think is an 2112 error no valid value for
that type of field).
I noticed that when I first choose numeric values to populate the combo
they align right as they should but then it (the combo) does not accept
string values. In the other case (first populate with stings and then
with numeric) it works fine. No errors. (This time the numeric values
are interpreted as string and align left).
After 6 hours of searching and wondering I found that if I choose in
design view as row source string values then when I return to normal
view I can select the values that populate the combo in any order (like
first numeric and then stings) without errors (numeric is interpreted
as strings but that was ok for me). This solved my problem but I wonder
why this is happening. It seems to me that a hidden (or not ?) property
of the combo is activated depended on the type of values that is first
populate it and this does not change afterwards (in normal view).
Please for your comment and sorry for my lengthy post.
Manolis.
an reasonable explanation of it.
I have a combobox that its rowsource property is populated with the
following code Me!cboWhat1.RowSource = Me!cboWhere1.Column(3). That is
the 2nd column of another combobox which in fact is an SQL sentence
like: SELECT DISTINCT tblPatientRecord.BirthYear FROM tblPatientRecord;
or SELECT DISTINCT tblPatientRecord.LastName FROM tblPatientRecord; Let
say the first time I choose the second choice (LastName) and then I
choose the first choice (BirthYear). So far so good I' m happy with the
results.
BUT! when my first choice is the BirthYear (that is numeric of course)
and then I try to choose LastName (string) an error is produced that
the value is not accepted. (I think is an 2112 error no valid value for
that type of field).
I noticed that when I first choose numeric values to populate the combo
they align right as they should but then it (the combo) does not accept
string values. In the other case (first populate with stings and then
with numeric) it works fine. No errors. (This time the numeric values
are interpreted as string and align left).
After 6 hours of searching and wondering I found that if I choose in
design view as row source string values then when I return to normal
view I can select the values that populate the combo in any order (like
first numeric and then stings) without errors (numeric is interpreted
as strings but that was ok for me). This solved my problem but I wonder
why this is happening. It seems to me that a hidden (or not ?) property
of the combo is activated depended on the type of values that is first
populate it and this does not change afterwards (in normal view).
Please for your comment and sorry for my lengthy post.
Manolis.