473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Enable/Disable the field in continous form conditionally

Hi all,

I am using the countinous form. I want to Enable/Disable the some
fields for perticular records as per the following condition when
open the form. I have written this code in "On Current Event". I go on
the perticular record its enable/dosable the following field for all
records. I have tried this code in "On Open Even" but there is no
effect.

Please help me to solve this problem.

Private Sub Form_Current()
If (Me.Grade = 9 Or Me.Grade = 10 Or Me.Grade = 11 Or Me.Grade = 12 Or
Me.Grade = 13 _
Or Me.Grade = 14 Or Me.Grade = 15) And Me.TotDay <= 40 Then

Me.ManagerApproval.Enable= False
Me.ManagerConfirmation.Enable= False
Else
Me.ManagerApproval.Enable= True
Me.ManagerConfirmation.Enable= True
End If
End Sub

thanks in advance.
Jun 27 '08 #1
2 4340

"Naushad" <nh*****@kockw.comwrote in message
news:d8**********************************@m3g2000h sc.googlegroups.com...
Hi all,

I am using the countinous form. I want to Enable/Disable the some
fields for perticular records as per the following condition when
open the form. I have written this code in "On Current Event". I go on
the perticular record its enable/dosable the following field for all
records. I have tried this code in "On Open Even" but there is no
effect.

Please help me to solve this problem.

Private Sub Form_Current()
If (Me.Grade = 9 Or Me.Grade = 10 Or Me.Grade = 11 Or Me.Grade = 12 Or
Me.Grade = 13 _
Or Me.Grade = 14 Or Me.Grade = 15) And Me.TotDay <= 40 Then

Me.ManagerApproval.Enable= False
Me.ManagerConfirmation.Enable= False
Else
Me.ManagerApproval.Enable= True
Me.ManagerConfirmation.Enable= True
End If
End Sub

thanks in advance.
I have always used the ! when referencing a control on a form.

Me![Grade]
Me![TotDay]
Me![ManagerApproval].Enable

Jun 27 '08 #2
Naushad wrote:
>I am using the countinous form. I want to Enable/Disable the some
fields for perticular records as per the following condition when
open the form. I have written this code in "On Current Event". I go on
the perticular record its enable/dosable the following field for all
records. I have tried this code in "On Open Even" but there is no
effect.

Please help me to solve this problem.

Private Sub Form_Current()
If (Me.Grade = 9 Or Me.Grade = 10 Or Me.Grade = 11 Or Me.Grade = 12 Or
Me.Grade = 13 _
Or Me.Grade = 14 Or Me.Grade = 15) And Me.TotDay <= 40 Then

Me.ManagerApproval.Enable= False
Me.ManagerConfirmation.Enable= False
Else
Me.ManagerApproval.Enable= True
Me.ManagerConfirmation.Enable= True
End If
End Sub

It might be better to use Conditional Formatting (View menu)
on the controls you want to disable.

Use the Expression Is: option with an expression like:

[Grade] >= 9 And [Grade <= 15] And [TotDay] <= 40

--
Marsh
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: HolaGoogle | last post by:
Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have to field.One is a "yes/no" field and another one is "number" field. To display the yes/no field...
2
by: HolaGoogle | last post by:
Can you please tell me the right way to do this?? it's realy important! thanks in advance... Hi all, Can you please tell me what's wrong with my code??? i do have this database in wich i have...
1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
3
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76)...
0
by: Ian | last post by:
When you add a control to the web form designer in VS.NET, say a label called "InheritanceTestLabel", VS.NET automatically adds the following line to the code-behind. protected new...
5
by: kaisersose1995 | last post by:
Hi, I am trying to add some visual confirmation to a continous form, to let the user know if a stored date on the form has passed. I have managed to set the background colour using a simple IF...
3
by: Pietro | last post by:
Hi all, First of all I'd like to thank you very very much ,as finally after many years of searching,I could find a code to disable/enable the shift key,but actually i cannot use the code as I'm...
10
by: viki1967 | last post by:
Disable/enable icon.gif Hi all. I have this form in the page.htm: <form action="form.asp" method="post" onsubmit="return(validateForm(this));"> <select size="1" name="t_im"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.