Continuous forms, locked until edit button, font color change affects all records (1 Viewer)

leeby

Registered User.
Local time
Yesterday, 18:37
Joined
Jan 27, 2015
Messages
15
Hi,

I have a continuous form displaying employee hours for each day. On entry the fields are locked so user has to press edit, mainly to prevent inadvertent changes. When edit is clicked, I set locked property to false and I want the color of the fields (textboxes) to change color to indicate edit mode for that record. The problem occurs when more than one employee is listed....when edit button is clicked all text box colors change and all fields for all records become editable.

I can understand why this might be happening (because the txtboxes are not unique to each record on the form they are referred to by the same name for each record) but not how to achieve what I want to achieve....I only want the colors to change and record to become editable for the current record.

Any thoughts, advice would be very much welcome

Thanks
Lee
 

leeby

Registered User.
Local time
Yesterday, 18:37
Joined
Jan 27, 2015
Messages
15
HI Jdraw,

Thanks for the quick response. It doesn't really give me what I need. It looks like it is just changing the value of one field based on another. The continuous form works perfectly well and does everything I need it to do. I want to have each textbox locked on entry to the form as it displays a list of employees and their projected hours for the coming week.

I don't want this to be changed inadvertantly, so I lock everything. Each row then has an edit button which changes the lock status. As the lock status changes, I want the color of the text in the text boxes to change to highlight the row being edited.

What happens is that all of the currently displayed rows on the form also change color and become editable, defeating my locking objectives.

hopes this helps to clarify

again. many thanks

Lee
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 11:37
Joined
Jan 20, 2009
Messages
12,851
Continuous Forms are all instances of the same form. Properties cannot be individually changed with VBA

It can be done using Conditional Formatting. The Enabled property of each instance can be linked to the format condition.

The button can be used to edit the value in a bound control for the current record. Then use this control as the basis for the Conditional Format. Switch the bound control value back again in the BeforeUpdate event of the Form.
 

Users who are viewing this thread

Top Bottom