Click here to Skip to main content
12,821,315 members (37,024 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
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 12-Dec-12 20:51pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

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
DileepkumarReddy 13-Dec-12 2:39am
Hi,I have got this 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)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 13 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100