set control value before loading the form

Posted on 2006-04-24
Last Modified: 2012-06-21
I am loading a form in access database called "add"..before loading this form I want to set all the checkboxes on this form to value 0. I mean empty white small checkboxes..The code to load is given below..please add the code to set the check boxes.

'stDocName = "Search"
'DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.OpenForm "Add", , , stLinkCriteria

Thank you.
Question by:Aiysha
    LVL 84
    You'd want to do this in the Load or Open even of your from named "Add":

    Sub Form_Load()
      Me.YourCheckboxName = False
      Me.YourNextCheckbox = False
    End Sub
    LVL 4

    Expert Comment

    Alternate method is that you can predefine the state of checkbox. that is by default value is zero which you can set by properties of checkbox.

    Chetan Sachdeva

    Author Comment


    I want to change the default value to zero, but for I dont know what reason, the properties of the checkbox does not have the default value option.
    LVL 84

    Accepted Solution

    The checkbox is part of an Option Group, and in this scenario only the Option Group (i.e. Frame) has a Default value.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now