Click here to Skip to main content
16,019,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a from consisting of 8 controls(textbox and combo) and i had to use this form for several reports.Based on particular report i have to enable or disable the controls.How can i do this dynamically..

Any one help me out..

Thanks in advance..
Posted

You could do it as.........

Using text value based conditions in your report
Textbox1.enabled = (Condition_In_Report = "Text_Value")


Using Numeric based values in your report
Combo1.Enabled = (Condition_In_Report = 6 or 9 or (12 and 3))


Just replace the numeric or text values that decide wether the control should be enabled or disabled.

Textbox2.Enabled = (Budget < Maximumvalue or Today = "Monday")  


You always mix and match too
 
Share this answer
 
select case lstrreportname
case "Sales Summary"
text1.enable = false
label1.enable = false
text2.enable = true
lable2.enable = true
csae "Collection Report"
text1.enable = true
label1.enable = true
text2.enable = false
lable2.enable = false

...
end select
 
Share this answer
 
Comments
DileepkumarReddy 13-Dec-12 2:39am    
Hi,I have got this idea..is there any other way that is dynamic than this?...

Thank You
kgmmurugesh 14-Dec-12 0:13am    
No, this is the best & easy way. Other wise you use tables to stores report name and Text name to do this process.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900