+ Reply to Thread
Results 1 to 5 of 5

How to capture value from Check Boxes

Hybrid View

  1. #1
    Registered User
    Join Date
    03-30-2008
    Posts
    32

    How to capture value from Check Boxes

    Hi All,

    Let me state my requirement first -
    In My excel sheet, if a user enters that database has been changed then i am throwing a form, which consist of 11 check boxes and each check box is mapped to a existing table.
    To capture the value i am using the event, and populating a global variable.
    Though this method is easy, but i don't like it.
    Is there any other way by which i can pass information from my form to the program.

    Regards,
    Tushar

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Your question doesn't give enough information. Which event are you using & what is supposed to happen?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-30-2008
    Posts
    32
    HI,

    Whenever you put a check box onto a form , a check box event is created and when you click that checkbox, the event is triggered.
    suppose -
    ChkBox1 - has Table1 as name
    ChkBox2 - Has Table2 as name

    When you click chkbox1, the event CheckBox1_Click() is triggered.
    To capture the vale i am doing the following -
    Private Sub CheckBox1_Click()
    TableChecked(2) = "TABLE1"
    End Sub
    TableChecked is a global array.

    What i want is alternative of what i am doing above.
    is there any other way by which i can know the values .


    Regards,
    Tushar
    Last edited by royUK; 05-13-2008 at 05:03 AM.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481
    You can check the state of the checkboxes via the userform object before you unload it. So you main routine may look like this,

    Sub Main()
    
    Userform1.Show
    
    msgbox Userform1.Checkbox1.Value
    
    Unload Userform1
    
    End Sub
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Tushar, please use Code tags when posting code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1