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

(un)locked

Status
Not open for further replies.

matrixindicator

IS-IT--Management
Sep 6, 2007
418
BE
Hey Everyone,

I have a Form on with the user select a customer. In the Form he shows the addresse of the customer. To avoid input of new customers along this form the fields with the addresse is locked. However, when he like to change a selected adresse he can unlock the access to the fields with a button.

Code:
 Forms![F01_ORDERS]!CUSTADRESSE.Locked = False

This works fine. He should lock the fields again automatically when navigating to a new or previous record in the form. What is the event to use, navigating to a new, a previous record, or leaving the existing record ?

Code:
 Forms![F01_ORDERS]!CUSTADRESSE.Locked = True

Thanks In Advance.
 
What is the event to use, navigating to a new, a previous record, or leaving the existing record ?

Since they are all separate events, I'd just put it in all 3. The reason is that any could occur, but may not always occur, therefore, putting it in all locations listed may be best....

Or another solution I use myself is to just put it in the On Load event of the form. You may have to also put it in an event related to "on refresh" or "on new record"...

--

"If to err is human, then I must be some kind of human!" -Me
 
ok, grouping them together, but I wonder is there an event related to going to another record ? Any, like the previous, a new, number 52 ...
 
how about just this
Private Sub Form_Current()
me.!CUSTADRESSE.Locked = True
End Sub

and unlock it when you want
 
How are ya matrixindicator . . .

You can also use the forms [blue]AfterUpdate[/blue] event!

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top