Results 1 to 8 of 8

Thread: checkbox help

  1. #1
    Join Date
    Mar 2003
    Posts
    225

    Unanswered: checkbox help

    how can i set up my form so that if i enter a date range and tick one of the boxes it runs the relevant report, the data range thing isn't an issue, i know that bit...

    but i need to know how to know that if checkbox1 is selected it will run the report for that.

    http://members.lycos.co.uk/redtilefc/check.jpg

    i am aware that i will need some fairly simple code to do this (I think) but just need a little help getting started please.

    My textboxes are called:

    text1, text2

    my checkboxes arer called

    check1,check2 etc

    my preview button is called:

    pre_but1

    and my reports are called

    rpt_1, rpt_2 etc..


    please help

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713

    Re: checkbox help

    Originally posted by Chimp8471
    how can i set up my form so that if i enter a date range and tick one of the boxes it runs the relevant report, the data range thing isn't an issue, i know that bit...

    but i need to know how to know that if checkbox1 is selected it will run the report for that.

    http://members.lycos.co.uk/redtilefc/check.jpg

    i am aware that i will need some fairly simple code to do this (I think) but just need a little help getting started please.

    My textboxes are called:

    text1, text2

    my checkboxes arer called

    check1,check2 etc

    my preview button is called:

    pre_but1

    and my reports are called

    rpt_1, rpt_2 etc..


    please help
    You've got to be kidding me ... At a minimum you could do something like:

    private sub CheckBox1_AfterUpdate()

    If CheckBox1.Value=True then Docmd.OpenReport Report1,acNormal

    End Sub

    - or -

    Have a "Print" button you click and then:

    Private Sub PrintButton_OnClick()

    If CheckBox1.Value=True Then Docmd.OpenReport Report1,acNormal

    End Sub

  3. #3
    Join Date
    Mar 2003
    Posts
    225

    Talking

    why am i kidding you???

    i cant help it....i am stupid

    thanks

  4. #4
    Join Date
    Nov 2003
    Posts
    1,487
    You're not stupid....you are simply learning.

    Please do not be afraid to ask any question you like regarding MSAccess within this forum.

    I hope M Owen's advise has helped you

  5. #5
    Join Date
    Feb 2004
    Location
    Binary Universe
    Posts
    57
    How about this:

    Create a [On Change] event procedure for your check box and in it like M Owen demostrated do the following:

    Private Sub CheckBox1_Change

    If CheckBox1.Value=True then Docmd.OpenReport Report1,acNormal

    End Sub
    I won't byte... hard!

  6. #6
    Join Date
    Mar 2003
    Posts
    225
    I have changed my checkboxes to an Option group now, and have successfully started to get this to work....

    is there a way of having more than 20 options available, i have 23 lines of machines and i can only choose the 20 from the option group menu.

  7. #7
    Join Date
    Feb 2004
    Location
    Binary Universe
    Posts
    57
    Your check boxes don't have to belong to an Option group. If you want more then 20 items enclosed create an Option group control and click 'Cancel' when 'Option Group wizard' pops up. You can place as many controls(check boxes) inside as you want. I usually use Option group control to isolate a group of controls for different parts of a form.
    I won't byte... hard!

  8. #8
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Originally posted by Chimp8471
    why am i kidding you???

    i cant help it....i am stupid

    thanks
    Well you're not gonna get anywhere with that kind of attitude ... This was a relatively simple question ... Here's a snapshot of what can be done (report selection wise) ... Enjoy.
    Attached Thumbnails Attached Thumbnails reports.bmp  

Posting Permissions

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