Results 1 to 10 of 10

Thread: Check Box help

  1. #1
    Join Date
    May 2005
    Posts
    125
    Provided Answers: 1

    Unanswered: Check Box help

    Hi

    I think Ive lost the plot, the database I'm currently working on Access 2000, I have created a reporting form, where users have to enter criteria to generate reports e.g date range to and from, custome etc... all working fine, what I need to do now is add a check box so that the user can choose to include carriage or not, eg, if check box = true, then include carriage if not exclude carriage, but I just cannot get my head around how to represent this function within the query

    Regards


    Mark

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    How about somethin like

    IIF(ckbCarriage,[CarriageValue],0)

    where ckbCarriage is the name of the checkbox to include carriage and CarriageValue is the field holding the carriage value for this particular customer/invoice !!

    Bit difficult to answer without knowing how/where/what event etc.


    MTB

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Assuming you're talking about the query that supports the report and that you want to include only records where Carriage = True when you say "include carriage" and to only include records where Carriage = False when you say "exclude carriage":

    WHERE [Carriage] = Forms!dlgReporting!chkCarriage
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    May 2005
    Posts
    125
    Provided Answers: 1
    Hi thanks so far, I think I really need to go and find a dark room, sry for being so vague

    I have attached a an example of data from the table, as can be seen I have multiple rows of data against 1 invoice, accross different sectors including carriage, what I would like to do if possible, from the main form, if the user checks the carriage chkbox, we include the row with carriage in, if the user does not check the chkbox, then the carriage line will be ommited from the report

    Where's that room, i'm having a very bad day
    Attached Files Attached Files

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Quote Originally Posted by MarkWhyte
    Hi thanks so far, I think I really need to go and find a dark room, sry for being so vague

    I have attached a an example of data from the table, as can be seen I have multiple rows of data against 1 invoice, accross different sectors including carriage, what I would like to do if possible, from the main form, if the user checks the carriage chkbox, we include the row with carriage in, if the user does not check the chkbox, then the carriage line will be ommited from the report

    Where's that room, i'm having a very bad day

    A suggestion always include the carriage in the query.. that way round your query works for when a product needs carraige or not.

    then in the presentation layer put the logic in to hide the carraige if not required.

    alternatively take advantage of the numeric represetnation of the boolean value... chedck what value is used, but normally true is 1 or -1, and false is zero. so you could get to your carraige calcualtion and multiply that by the abs(value) of the boolean checkbox. if you do go down that route be very very cautious about moving the code to another db engine, or upgrading to a new form of access.

    I suppose it depends on how complex the shipping rate calculation is.

    Sometimes Ive had to define fiendishly complex tables & queries to support the customer requirements, sometimes Ive had to resort to an inline function.

  6. #6
    Join Date
    May 2005
    Posts
    125
    Provided Answers: 1
    Thanks for your ideas and help, there is light at the end of the tunnel now

  7. #7
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Let's just hope it's not an oncoming train ^^
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Haha ST, that embarassingly made me laugh out loud in a room full of people sitting quietly...
    George
    Home | Blog

  9. #9
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Goody!

    I like making people happy
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  10. #10
    Join Date
    May 2005
    Posts
    125
    Provided Answers: 1
    Nice1 St

Posting Permissions

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