Trap click

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sigurd Bruteig

    Trap click

    Hi all!

    I keep the subform locked until certain fields in the main for is filled
    in. Is it possible to trap if the user clicks a field in a subform that is
    locked.

    Sigurd


  • Nigel Lawrance

    #2
    Re: Trap click

    If the field was called MyField . . .

    If Me.MyField.Lock ed = True Then
    MsgBox "This field is locked."
    End If

    Nigel
    [color=blue]
    > I keep the subform locked until certain fields in the main for is filled
    > in. Is it possible to trap if the user clicks a field in a subform that is
    > locked.
    >
    > Sigurd[/color]


    Comment

    • Nigel Lawrance

      #3
      Re: Trap click

      sorry - forgot to include . . .

      Add this code to the GotFocus event

      Private Sub MyField_GotFocu s()
      If Me.MyField.Lock ed = True Then
      MsgBox "This field is locked."
      End If
      End Sub


      Comment

      • Sigurd Bruteig

        #4
        Re: Trap click


        "Nigel Lawrance" <nal@exeter37.f reeserve.co.uk> wrote in message
        news:bjpqhg$1ko $1@newsg4.svr.p ol.co.uk...[color=blue][color=green]
        > > It seems like the locked control or subform don't react to anything, it[/color][/color]
        is[color=blue][color=green]
        > > truly locked. Have tryed both got_focus and mouse_down event with same
        > > result. Are you sure this is working?[/color]
        >
        > Yes it works fine on my form.
        >
        > When you say the subform is locked - what do you mean exactly?
        > Also, are the fields set to Enabled False?
        >
        > I suggested GotFocus so that if you tabbed OR clicked into the field it
        > would tell you if it was locked.
        > You could use the OnClick event if you wanted to trap when someone clicked
        > into the field.
        >
        > Can you click into the field at all?
        >
        > Nigel
        >[/color]
        It seems like i have used enabled=false in addition to locked=true. When I
        change this it works like you say. Thanks again

        Sigurd


        Comment

        Working...