hide check box in form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barkarlo
    New Member
    • Nov 2006
    • 59

    hide check box in form

    How can I write code who will hide check box in a form after confirmed.
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    You need to create an after update event on the checkbox control.

    If your checkbox name was check1 then ...
    [code=vb]
    Private Sub check1_AfterUpd ate()

    If Me!check1 = -1 Then
    ' move focus to the next control on the form
    Me!ctlName.SetF ocus
    Me!check1.Visib le = False
    Else
    Me!ctlName.SetF ocus
    Me!check1.Visib le = True
    End If

    End Sub

    ' The following code would also need to be placed in the On Current event of the form.
    Private Sub Form_OnCurrent( )

    If Me!check1 = -1 Then
    ' move focus to the next control on the form
    Me!check1.Visib le = False
    Else
    Me!check1.Visib le = True
    End If

    End Sub
    [/code]

    Comment

    Working...