Check Box

  • Thread starter Thread starter Froto
  • Start date Start date
F

Froto

I would like to change the following Code to allow a user
to be able to uncheck the checkbox should they change
there mind, right now it's not allowing them to. Help
with the code would be very much appreciated.

If Me!Check55 = True Then
Me!MolecularWeight.BackColor = vbYellow
Me!MolecularFormula.BackColor = vbYellow
Else
Me!MolecularWeight.BackColor = vbWhite
Me!MolecularFormula.BackColor = vbWhite
End If
If Me.Check55 = -1 Then
MolecularWeight.SetFocus
End If

Thank you
 
Note:
If Me!Check55 = True Then

... can be written as ...

If Me!Check55 Then

Try this...

If Me!Check55 Then
' Force the unchecking of it
Me!Check55 = Not Me!Check55
Me!MolecularWeight.BackColor = vbYellow
Me!MolecularFormula.BackColor = vbYellow
Me!MolecularWeight.SetFocus
Else
Me!MolecularWeight.BackColor = vbWhite
Me!MolecularFormula.BackColor = vbWhite
End If


--
Rob

FMS Professional Solutions Group
http://www.fmsinc.com/consulting

Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
Back
Top