Results 1 to 4 of 4

Thread: Disable fields

  1. #1
    Join Date
    Aug 2004
    Location
    NY
    Posts
    113

    Unanswered: Disable fields

    Hi,

    What I am trying to do is disable/lock fields after a command button has been selected. For example, A user enters in data in lets say the first half of the form. Looks everything over and then want's to lock the info so no other user can make changes. When the DB is opened the next time those fields have been locked.

    Thanks

  2. #2
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    Hi,

    There are about three things to consider. If a value is entered and the command button is selected, the your code must analyze the values and lock the appropriate fields. Additionally, when a user opens the form, your code will have to analyze the values and lock the appropriate fields. Finally, when a user moves to each new record, your code must analyze the values and lock the appropriate fields.

    So write a function that looks at the fields necessary and then locks the controls that you want to lock. Call that function in the following cases, when they click the button, and from the form event "on_current".
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

  3. #3
    Join Date
    Aug 2004
    Location
    NY
    Posts
    113
    I am able to lock the fields when I click on the command button. I am running into an issue when I reopen the database. How do I tell the database that those fields have been locked?

  4. #4
    Join Date
    Jun 2002
    Location
    Mpls/St.Paul area
    Posts
    303
    You can't read something to see if they have been locked (well you can...you can do anything .... its only software).

    The practacal method is to do what i recommended above. First, how do you determine whether a field should be locked? The user clicks a button, and your code checks on values and locks or disables controls. Correct?
    Now use the same code on the for event called 'on current'.

    Controls have events, like 'on click' or 'on mouse over' or 'on double click'. Similarly the whole for has properties (including events). One of these events is 'on current'. Check it out.

    .
    John
    This is the day the Lord has made, I will rejoice and be glad in it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •