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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code for yes/no checkboxes

Status
Not open for further replies.

pazgb

Programmer
Jun 9, 2003
60
US
I need to check yes/no checkbox fields to see if it is checked in table per record. Then, if the checkbox is checked, I need to display the field name(s) on the report.

Anyone have any ideas?

Michael


 
Hi pazgb,

You could try something like this in your Report's controls:

If Me!MyCheckBoxName = True then
Me!MyReportControl1 = Me!WhatEverOtherControl1
Me!MyReportControl2 = Me!WhatEverOtherControl2
Me!MyReportControl3 = Me!WhatEverOtherControl3
End if

Bill
 
It won't let me set the text property in the report. I can check to see if it is true but i can't set the value to the text property in the report.
 
You can set the visible property in the ONformat in the report...

OnFormat

If forms!myform!mycheckbox = true then
me!mylabel1.visible=true
me!mylabel2.visible=false
else
me!mylabel1.visible=false
me!mylabel2.visible=true
end if

End sub



Even simpler, if you are just setting one..

Onformat

me!mylabel.visible-forms!myform!mycheckbox

End sub


HTH



 
That will probably work, but I dont have alot of space on the report, I would have about 60 different labels. Is there a way to concantante a variable so it can all be combined into one label?

Like if checkbox1=true then
concantantedVar = concantantedVar + checkbox1Var
end if
if checkbox2=true then
concantantantedVar = concantantedVar + checkbox2Var
end if

something like that. would that work?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top