Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compare a checkbox with what I have in my Table 1

Status
Not open for further replies.

RSX02

Programmer
May 15, 2003
467
CA
Hi
I compare this where ChkSpaceHeatingCoil is a checkbox in my form and where DRPUBLICVIEW.Item("Space_heating_coil") is a field that I have in my table that is declared as integer. When ChkSpaceHeatingCoil.Checked is set to True I put 1 in my record. Now this :

If Me.ChkSpaceHeatingCoil.Checked <> DRPUBLICVIEW.Item("Space_heating_coil") Then haschanges = 1

set the haschanges variable to 1 even if my record is set to 1 and my checkbox is checked.
Why it does this and how can I solve it?
Thanks in advance
 
the checkbox will return -1 if true so this will work better

Code:
If cint(Me.ChkSpaceHeatingCoil.Checked) * -1 <> DRPUBLICVIEW.Item("Space_heating_coil") Then haschanges = 1
[code]

Christiaan Baes
Belgium

[b]If you want to get an answer read this FAQ faq796-2540[/b]
[i]There's no such thing as a winnable war - Sting[/i]
 
Hi Christiaan
I have a similar problem.
Here it is:
I execute this code:
Dim teste As String
teste = CType(actl3.Checked, Boolean) & " " & CType(Me.TempImperial, Boolean)
If CType(actl3.Checked, Boolean) <> CType(Me.TempImperial, Boolean) Then haschanges = 1

In the teste variable it put "True True"
but it execute the assignement to the "haschanges" variable.
What am I doing wrong once again?

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top