Reading a checkbox

B

Bill Williamson

I've got a yes/no field in a data base which is linked to a checkbox on a
form. Now I would like to change the color and size of a label dpending on
the value (0 or 1) of the data. I've written the subroutine, but can't seem
to get it to run when the database record is changed. None of the checkbox
event procedures will run unless data is being input via the form. Thanks
for any help.
 
J

Jonathan Parminter

Bill Williamson said:
I've got a yes/no field in a data base which is linked to a checkbox on a
form. Now I would like to change the color and size of a label dpending on
the value (0 or 1) of the data. I've written the subroutine, but can't seem
to get it to run when the database record is changed. None of the checkbox
event procedures will run unless data is being input via the form. Thanks
for any help.

Hi Bill, use the form_Current() event to run code the is associated with a
new current record. That is as the form fills with the current record you can
check the value of the field/control and so forth...

Luck
Jonathan
 
P

PC Datasheet

Put the following code in the AfterUpdate event of the Checkbox:
If Me!NameOfCheckbox = True Then
Me!NameOfLabel = "Number Of Color"
<Code to change size - don't know what you mean by size. Font?>
Else
Me!NameOfLabel = "Number Of Color"
<Code to change size - don't know what you mean by size. Font?>
End If

Put the following code in the Form's OnCurrent event:
Me!NameOfCheckbox = False
Me!NameOfLabel = "Number Of Color"
<Code to change size - don't know what you mean by size. Font?>
 
R

rkc

Bill said:
I've got a yes/no field in a data base which is linked to a checkbox on a
form. Now I would like to change the color and size of a label dpending on
the value (0 or 1) of the data. I've written the subroutine, but can't seem
to get it to run when the database record is changed. None of the checkbox
event procedures will run unless data is being input via the form. Thanks
for any help.

Have you tried running your routine from the Form's Current event?
 
B

Bill Williamson

yes, Font size - sorry about that. Thanks much.

PC Datasheet said:
Put the following code in the AfterUpdate event of the Checkbox:
If Me!NameOfCheckbox = True Then
Me!NameOfLabel = "Number Of Color"
<Code to change size - don't know what you mean by size. Font?>
Else
Me!NameOfLabel = "Number Of Color"
<Code to change size - don't know what you mean by size. Font?>
End If

Put the following code in the Form's OnCurrent event:
Me!NameOfCheckbox = False
Me!NameOfLabel = "Number Of Color"
<Code to change size - don't know what you mean by size. Font?>

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 

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