• Default Value in field

    Author
    Topic
    #458557

    Hi, on a form I have a tick box and a field for a completion date. I would like the date field to auto fill with the current date when the tick box is set to yes and clear when not. what would be the best way of modeeling this?

    Many thanks, Darren.

    Viewing 0 reply threads
    Author
    Replies
    • #1153425

      In the AfterUpdate event of the checkbox use the following code:

      Code:
      Private Sub Check0_AfterUpdate()
      If Me.Check0 = True Then
      	Me.Text2 = Date
      Else
      	Me.Text2 = ""
      End If
      End Sub

      Replace Text2 and Check0 with the names of your controls.

    Viewing 0 reply threads
    Reply To: Default Value in field

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: