G
Guest
I'm working with a combo box on a form in Access 2000, and trying to pick up
the value of the third column (actually column number 2, ie. 0, 1, 2) using
the following code:
Dim PWSN As Integer
PWSN = Me.cboSNum.Column(2)
When the code runs, I get a run-time error '94': Invalid use of Null.
However, while I'm in debug mode, if I change the column number to 0 or 1
(these are text values in the combo box), I get the error stating a type
mismatch (which is correct). Continuing while I'm still in debug mode, I
change the column number back to 2 (after the type mismatch error), suddenly
the code works and picks up the Integer value I want and works fine.
Unfortunately, when I run the code outside of debug mode I get the "Invalid
use of Null" error. In case you are curious, the third column has an Integer
value for each item in the combo box, it just won't pick it up unless I trick
it this way.
In the past I have noticed that when I try to pick up column values higher
than column 1, I have trouble. Is this some kind of a qwerky bug within
Access or am I doing something wrong?
TIA,
Al
the value of the third column (actually column number 2, ie. 0, 1, 2) using
the following code:
Dim PWSN As Integer
PWSN = Me.cboSNum.Column(2)
When the code runs, I get a run-time error '94': Invalid use of Null.
However, while I'm in debug mode, if I change the column number to 0 or 1
(these are text values in the combo box), I get the error stating a type
mismatch (which is correct). Continuing while I'm still in debug mode, I
change the column number back to 2 (after the type mismatch error), suddenly
the code works and picks up the Integer value I want and works fine.
Unfortunately, when I run the code outside of debug mode I get the "Invalid
use of Null" error. In case you are curious, the third column has an Integer
value for each item in the combo box, it just won't pick it up unless I trick
it this way.
In the past I have noticed that when I try to pick up column values higher
than column 1, I have trouble. Is this some kind of a qwerky bug within
Access or am I doing something wrong?
TIA,
Al