Results 1 to 6 of 6
  1. #1
    lil2lam is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    1

    Ticking Checkbox Upon Clicking Button on Form

    Hello -

    I am still a little new to forms, buttons, checkboxes, and binding stuff....so please, any details will help greatly !!



    I have created a form.
    In the form I created 5 buttons.
    Each button will run a set of queries or code upon clicking them.

    I want to create 5 checkboxes right next to these buttons.
    I want each checkboxes to automatically check upon clicking each button that is next to the check box.

    Can anyone help me with this ??

  2. #2
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    I got ya, Look at the code below. On my form I have 2 options, when they hit a button I want to check to see if those buttons have value, if they do then I call another routine...



    Code:
    Private Sub cmdRun_Click()
    MsgBox "Depending on the size of the report, there might be a delay.", vbOKOnly, "LIFT"
    If opWest.Value = True Then
    Call WestHills
    End If
    If opWest.Value = False Then
    End If
    If opPhilly.Value = True Then
    Call Philly
    End If
    If opPhilly.Value = False Then
    End If
    MsgBox "Reports are ran.", vbOKOnly, "LIFT"
    End Sub
    Might be able to skate with this,

    Code:
    Private Sub cmdRun_Click()
    MsgBox "Depending on the size of the report, there might be a delay.", vbOKOnly, "LIFT"
    If opWest.Value = True Then
    Call WestHills
    End If
    If opPhilly.Value = True Then
    Call Philly
    End If
    MsgBox "Reports are ran.", vbOKOnly, "LIFT"
    End Sub
    --Edit--
    Sorry for stringing this along, I just re read your post... seems like you want to make the check mark appear after the button is hit... I am using some google fu, however I can't get anything to work.

  3. #3
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    If that works, PLEASE let me know. I am new at all of this and I like to help out when I can. BTW I am sure there is a better way of handling this, but this is how I was able to get it working.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by lil2lam View Post
    Hello -

    I am still a little new to forms, buttons, checkboxes, and binding stuff....so please, any details will help greatly !!

    I have created a form.
    In the form I created 5 buttons.
    Each button will run a set of queries or code upon clicking them.

    I want to create 5 checkboxes right next to these buttons.
    I want each checkboxes to automatically check upon clicking each button that is next to the check box.

    Can anyone help me with this ??
    Try this line of code in the On Click event of a button:
    Code:
    Me.NameOfYourCheckBox = Not Me.NameOfYourCheckBox
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    I just tried that on my form, did not seem do anything. The option I tried on was an independent option, not inside the frame or option grouping. I'm not sure if that would make a difference.

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Try setting the controls "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

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

Similar Threads

  1. Replies: 7
    Last Post: 12-17-2011, 08:06 PM
  2. Replies: 5
    Last Post: 11-11-2011, 11:06 AM
  3. Comments when clicking a button
    By Juan4412 in forum Programming
    Replies: 4
    Last Post: 06-23-2011, 04:34 PM
  4. radio button and checkbox
    By Fifa in forum Access
    Replies: 2
    Last Post: 01-19-2011, 10:20 AM
  5. Enable button in the master form when clicking in the detail
    By DistillingAccess in forum Programming
    Replies: 8
    Last Post: 08-03-2010, 10:54 AM

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