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

Field being disabled/enabled based on a checkbox

Status
Not open for further replies.

Chris1977

Technical User
Feb 2, 2003
50
US
I have what will probably be a simple question for you to solve but it's stumping me.

What i have is a form where scheduled meetings will be stored. Right now the dates are being kept along with meeting time, employee/employer names etc. There are two memo fields.....one for meeting reason and one for meeting result. I set the enabled value on the txtMeetingResult to be False so users will have to check the box chkMeetingCompleted for it to be editable. This works fine for an individual record. However when i click to create a new record it retains the settings of the previous record meaning the txtMeetingResult is enabled again whether or not the check box is checked.

So is there any way i can keep the original settings of txtMeetingResult disabled until the check box is checked for each individual record? Any help you folks could give would be appreciated.

Thanks
 
in the oncurrent event

if checkbox = true then
txtmeetingresult.enabled = true
endif Christiaan Baes
Belgium
"What a wonderfull world" - Louis armstrong
 
I initially had similar code on the "on-click" event for the checkbox. It looked something like this:

If chkmeetingcompleted = True Then
txtMeetingResult.Enabled = True
Else
txtMeetingResult.Enabled = False
End If

The problem was that the MeetingResult field was still enabled when we went to the next record. I tried setting the default value for this field to enabled=no but that didn't change anything. I also placed the code you provided in the "on current" event for the form but it didn't seem to have an affect.

So, what we need it to do is keep txtMeetingResult disabled until the box is selected regardless of which record we are on. Thanks.
 
try this in before insert

txtMeetingResult.Enabled = True

and set the defaultvalue of chkmeetingcompleted = 0

Christiaan Baes
Belgium
"What a wonderfull world" - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top