Setting controls on Continuous Forms

AndyV

Registered User.
Local time
Today, 19:36
Joined
Apr 24, 2008
Messages
32
I have inherited a database designed by an ex employee, and I have been asked by the users to add a checkbox to a continuous form. When the check box is set, they want a date field on the record to be set, and then all of the controls on the record to be locked. Is this possible to do, because I seem to have a problem where all of the controls on every row are disabled. Has anyone got any ideas?
 
Maybe this would work:

1. Add a field to the table that stores the check box value. So when you check/uncheck it you are storing that for each record.

2. Then in the forms "OnCurrent" event turn the enabled/disabled property on/off based on the check box field.

Hope this makes sense....
 
OK, I added a field called txtEnabled, that is set to either Enabled or Disabled based upon the setting of the check box (named Completed) as follows:

=IIf([Completed]=False,"Enabled","Disabled") This works at a record level.

I then tried to set the font colour of a record in the continuous form setting the font colour of another field on the form based upon the value of the txtEnabled field:

Private Sub Form_Current()
If Me.txtEnabled = "Disabled" Then
Me.Payee.ForeColor = 255
End If
If Me.txtEnabled = "Enabled" Then
Me.Payee.ForeColor = 0
End If
End Sub

If you set the check box, the new field sets correctly, but the font colour of every record now changes to 255.

Am I missing something?
 
Yes. If you do the color thing all of them will change. However, if you do something like enable/disable a control it will enable/disable all of the but the user will never realized this because it nothing happens on the screen. BTW. To make this transparent you may want to toggle the 'Locked' property and not the enabled property as this will grey out the controls on all of the records and the user will see that happening and may not be the effect you want...
 
When the check box is set, they want a date field on the record to be set, and then all of the controls on the record to be locked. Is this possible to do, because I seem to have a problem where all of the controls on every row are disabled. Has anyone got any ideas?

once you lock the fields they are locked for every row

so in the current event you need to test the date/flag setting and lock/unlock the fields again as necessary

with a continuous form you cant avoid everything changing colour (you can partially with conditional formatting) - but when your users get used to it, its not the end of the world
 
Many thanks Ken. It works perfectly. After update event of the check box is set to move to the next record and all is OK. Thanks once again.
 

Users who are viewing this thread

Back
Top Bottom