473,388 Members | 963 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,388 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 4337

"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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.