Results 1 to 6 of 6
  1. #1
    rossi45 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    12

    Clearing Checkbox on New Record


    Hey everyone,

    is there a way to clear a check box in a form if you add a new record?

    I tried:

    Code:
    If Me.NewRecord = True Then
    Me.checkbox = False
    That doesn't seem to work when I have placed a check in the checkbox on the current record, and then create a new record, the checkbox stays.

    Any suggestions?

    Thanks, Mike

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    How about setting it's Default Value property to False.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    rossi45 is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2012
    Posts
    12
    Thanks Bob. I tried that and it still remains checked. I tried programming it into the after update event on the checkbox and before insert and after insert events on the form...

  4. #4
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75
    Check the underlying table field. It may have a default value set to true.

  5. #5
    Join Date
    Apr 2012
    Location
    Los Angeles
    Posts
    75
    Couple of other things to check:
    1-Is the checkbox bound to a field from the table?
    2-What is the actual name of your checkbox - make sure you have the naming correct also in your code. There are two properties in Access for a control - the bound name of the field and the name of the control. Go into Properties and select the "Other" tab and check the Name property. This is how you need to refer to it in VBA code.

    Hope this helps.

  6. #6
    Phil1 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    14
    To clear a checkbox, I'd simply change it's 'Value'....

    to clear the checkbox type:

    cbMyCheckBox.Value = False

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Clearing a Form
    By dabatman in forum Forms
    Replies: 4
    Last Post: 01-20-2012, 11:51 AM
  2. Clearing certain boxes on form for next record using VB
    By justinwright in forum Programming
    Replies: 3
    Last Post: 07-21-2010, 12:16 PM
  3. Error when clearing form
    By turbo910 in forum Forms
    Replies: 11
    Last Post: 11-26-2009, 11:03 AM
  4. clearing a form
    By macsterling in forum Forms
    Replies: 0
    Last Post: 07-31-2008, 10:38 AM
  5. Clearing the clipboard with VBA?
    By Simon Sweet in forum Programming
    Replies: 1
    Last Post: 04-17-2008, 03:16 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums