Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Thanked 0 Times in 0 Posts

    Locking a Form and SubForm

    I'm looking for a way to lock out or disable a mainform and the subform on it if the record is not new.. So if the record is new it will allow the user to make additions.. I can lock out the main form using Forms![Formsname].allowedits = false but this does not lock out the subform. Any help is greatly appreciated. P.S. Charlotte thanks for the help you gave me over the weekend it worked great!!

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Sacramento, California, USA
    Thanked 1 Time in 1 Post

    Re: Locking a Form and SubForm

    When you say "lock out the subform", what do you mean. If all you want to do is prevent them from doing anything (including scrolling) in the subform, lock the subform control. You could even set it locked in design view and only unlock it under the appropriate circumstance.

    However, if you lock the control, the user would not be able to scroll through any records there. As an alternative, set the subform's properties to allowedits = false, etc., and turn them on from code when you have a new record in the parent form. You can put something like this in the BeforeUpdate event of the parent form:

    <pre> If me.NewRecord Then
    With Me!subformcontrol.form
    .allowedits = true
    .... etc.
    End With
    End If</pre>


Posting Permissions

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