Reading a checkbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
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?>
 
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?
 
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
 
Back
Top