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

Enabled & Locked properties

Status
Not open for further replies.

zahara666

Technical User
Nov 1, 2001
78
0
0
CA
I have a form that is shown continuously on the screen. If a user makes a change to one field on the form that currently has the control, I need another field (for that record) to be either enabled or locked (and remain that way - even if the person exits the form and comes back). However, when I try to disable a field, it disables that field in ALL the records for each form. However, I only want it to disable the current record in the current form. Not in all the records that are shown by scrolling down.

Hope that makes sense and that someone can help!

J.
 
Since it's a form control, you may not be able to enable/disable for one record alone. When you say enable/disable, it does it for the form rather than the record. You can use the OnCurrent event to enable/disable based on the current record. It will enable/disable the control for all records, however. Of course, when someone tries to get to the control in another record, it may become disabled as that record becomes the current one. For what you're trying to do, you may not want to do continuous forms. With just a single form, it will look like it's only enabling the control for the current record. When they go to another record, it will disable the control based on the record. If that doesn't work for you, someone else might have a better answer.
 
How do you enable that field?

Is it enabled all the time or not

If you enable by clicking on a certain button, then write an On Exit or After Update Event Procedure that disables it as soon as he leaves that field. The user cannot click at 2 places in the same time.
 
My understanding is you have a form something like this:

Record1 <info1> <info2> <info3>
Record2 <info1> <info2> <info3>
Record3 <info1> <info2> <info3>
etc

What you want to do is if a person changes <info1> for Record1, that they can then nolonger change <info2> for record1, but can change it for Record2 or any other record.

To do this, you will need to add a boolean field to your database (fRecordChanged). Give the field <info1> an on change event to set fRecordChanged to true. Then give Info2 a gotfocus event that does:

if fRecordChanged Then
<info3.setfocus>
endif

This will prevent the data in <info2> from being changed for that record.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top