Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Check Box (2003)

    Hi,

    I have a check box in a form of database. I would like to setup if user check the check box then the other two fields will auto fill in user name & date. If the user uncheck the check box, then those two fields will be blank. The codes that I wrote are working for check the check box, but I don't know how should I write the code to make those two fields blank if the user uncheck the box. Please see code that I put under onclick property of check box below:

    Me.Activatedby.Value = GetNetUser()
    Me.ActivatedDate = Date

    Thanks

    Regards

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Check Box (2003)

    Try something like this:

    Private Sub CheckBox_Click()
    If Me.CheckBox = True Then
    Me.Activatedby.Value = GetNetUser()
    Me.ActivatedDate = Date
    Else
    Me.Activatedby.Value = Null
    Me.ActivatedDate = Null
    End If
    End Sub

  3. #3
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Check Box (2003)

    It works as always.

    Thank you so much, Hans.

Posting Permissions

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