Formats: Clearing all text-, check and comboboxes except for one box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lollebolle
    New Member
    • Jun 2007
    • 3

    Formats: Clearing all text-, check and comboboxes except for one box

    Hi Expert,

    I want to clear all fields in a format when I push my clear button except for the textbox ' Date ' which contains the current date as a default value.

    I'm using the following code:
    Dim ctl As Control

    For Each ctl In Me.Section(acDe tail).Controls
    Select Case ctl.ControlType
    Case acTextBox, acComboBox
    ctl.Value = Null
    Case acCheckBox
    ctl.Value = True
    End Select
    Next
    Me.Filter = "(false)"
    Me.FilterOn = True

    This cleans all fields.

    Can you help me out?
    Thank you,
    Tom
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    Originally posted by lollebolle
    I want to clear all fields in a format when I push my clear button except for the textbox ' Date ' which contains the current date as a default value.
    This is somewhat confusing. I assume when you say "all fields in a format" you actually mean all fields in a form.We need a little more information in order to help you. Is your form bound or unbound? And why are you clearing the form? In order to enter a new record, perhaps?

    Welcome to bytes!

    Linq ;0)>

    Comment

    • lollebolle
      New Member
      • Jun 2007
      • 3

      #3
      Originally posted by missinglinq
      This is somewhat confusing. I assume when you say "all fields in a format" you actually mean all fields in a form.We need a little more information in order to help you. Is your form bound or unbound? And why are you clearing the form? In order to enter a new record, perhaps?

      Welcome to bytes!

      Linq ;0)>
      Hello linq,

      indeed, my excuses for the confusion, I mean form. It is indeed for clearing fields to enter a new record.
      My form is unbound and I'm using the VB funciton "Date()" as default value but after clearing this field is also blank.

      Does this help you?

      Thanks,
      Tom

      Comment

      Working...