True or 1 ?

  • Thread starter Thread starter Agnes
  • Start date Start date
A

Agnes

my datafield is "bit" type, I can put 1 or zero into the current item.
e.g bm.current.item("lock") = 1 , (sucesfully)
However, if bm.current.item("lock") = 1 then messagebox.show("warning")
The above statment didn't work . Finally, I solve that by...if
bm.current.item("lock") = true then messagebox.show("warning")
I don't understand.. why (1) cannot be used ???
 
Hi Agnes,
my datafield is "bit" type, I can put 1 or zero into the current item.
e.g bm.current.item("lock") = 1 , (sucesfully)
However, if bm.current.item("lock") = 1 then
messagebox.show("warning") The above statment didn't work . Finally,
I solve that by...if bm.current.item("lock") = true then
messagebox.show("warning") I don't understand.. why (1) cannot be used ???

"BIT" is a booelan field, so the value "1" is mapped to the boolean value
"true" which is a different Datatype in VB.NET.

BTW: If bm.CurrentItem("lock") = true is wrong ... correct would be:

If bm.CurrentItem("lock") Then ...

Regards,

Frank Eller
www.frankeller.de
 

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

Back
Top