dealing with Null and zero-lenght string and...listbox

R

rocco

Hello,
I’m working on something that seems easy but that is driving me crazy…
To make it simple, just think to an UNBOUND form with two UNBOUND textboxes
and an UNBOUND listbox (2 columns).
By hitting a commandbutton data from the two textboxes are used to populate
the listbox:
value of the first textbox goes into first column of the listbox; value of
the second textbox goes into second column of the listbox.
Then I will use the items of the listbox to enter data into a table (2
fields to store data for each column of the listbox).
On loading the form one of the textbox is not enabled. It will be enabled
depending on the data entered on the first text box.
Now, please think to these 3 possible actions:

a) first text box value “a†second textbox not enabled
hit the button to populate the listbox and you see
first column: a second column: blank

b) first text box value “b†second textbox enabled but no value
entered (I mean never receive focus either)
hit the button to populate the listbox and you see
first column: b second column: blank

c) first text box value “c†second textbox enabled and value 1
hit the button to populate the listbox and you see
first column: c second column: 1

But if you question the values for each row of the list box you will have
that, despite the second column shows blank in cases a) and b), its value for
this column is Null in case a) and zero-length string in case b).
Can you confirm it should work this way?

Last…if I try to populate the table by transferring the data from my listbox
I get an error. It seems it doesn’t like to transfer the Null value for the
second column of the listbox into the second field of the table (which is
numeric). Why?

I can post code if necessary.

Thanks!
Rocco
 

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

Top