Change Checkbox appearance

Rubi

Registered User.
Local time
Today, 11:32
Joined
Jul 23, 2003
Messages
32
Hello everyone,
I have a form containing customer details. one of the controlers is a checkbox which source is a yes/no field in the my 'customers' table.
I'm trying to invert the checkbox so it would show TRUE when the value is False and vice versa. (and change the values in the table with the original TRUE/FALSE.

can anyone please help ??
 
Create another column in your table and call it 'Value' then put this code in the OnClick event of your CheckBox
Code:
Private Sub YourCheckBox_Click()
If Me.YourCheckBox = True Then
Me.Value = "False"
Else
Me.Value = "True"
End If
End Sub

IMO
 
Last edited:
Rubi,

One way of accomplishing this is to make your checkbox invisible.

Make a new unbound textbox - txtCheck.

Its default value can be "True" or "False".

In the OnCurrent event for your record:

Code:
If Me.MyCheckBox = True Then
   Me.txtCheck = "True"
Else
   Me.txtCheck = "False"
End If

In the AfterUpdate of txtCheck:

Code:
If Me.txtCheck = "True" Then
   Me.MyCheckBox = True
Else
   Me.MyCheckBox = False
End If

Just some rough ideas ...
Wayne

IMO's response made me reread your post. I was thinking that
we were trying to do something entirely different.

Never mind ...
 
Last edited:
Thanks WayneRyan,
I have some questions though...
1)what is : "OnCurrent Event for your record", what record do you mean ? and where can I insert the code ?

2) can this solution work on a "Tabular" form ?
 
Sorry IMO :)

I appreciate your help vary much,
I've tried your suggestion and it didn't do exactly what I wanted.
I need the controler to change the original checkbox field.

thanks,
 
IMO,

Could you explain your solution please, I think I misunderstood it.
it may be the right way to do this after all.
 
If you create the Column 'Value' in your table, if the CheckBox is clicked (True) the 'Value' field would show False

IMO
 
Last edited:

Users who are viewing this thread

Back
Top Bottom