Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Unanswered: Report Help!! Should be easy :)

    I have a form that the user inputs data to generate a sales order. From the form they can click to view and print the report(sales order).

    The problem I am having is...

    I have two check boxes that when checked. Allow the user to enter a currency value in the text box to the right.

    When they view the report I dont want the values showing up unless that check box has been selected (There is a discount field which if someone isnt getting a discount then I dont want them to know that). Is there any way to do this? My report is based on a query.

    JS
    Last edited by JSThePatriot; 05-20-04 at 18:31. Reason: title no good ;)
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi JS

    So there will only be a value in the text box to the right if the two check boxes on the form are ticked? Then in the form OnLoad event would

    If forms!YourForm!RightTextBox >0 Then
    'choose the appropriate option below
    Me.discount.visible = false
    Me.discount = ""
    End If
    do the job?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    You are half way there... I know how to do that on my form. I dont know how to do that on a report. The report is what I am needing to have the values hidden because we print it out and hand that to the customers.



    I tried in the on open even but it said it was invalid.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  4. #4
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    JS,

    I have very little do with Reports but I think I read somewhere that only unbound text boxes can have their properties altered, at least externally.

    Am I reading your post incorrectly or could you just have for report query

    IIf([Purchase]>=$1000,.2,Null).

    Then for the labeling which I am assuming your report might have

    Your Discount is $20

    The "Your Discount" could be a field that with an IIF either has Your Discount or is Null.

    Mike

  5. #5
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Okay hmm.... I have One check box called discount, and the text box is damount (standing for discount amount). I need on the report for the discount box to show up only if the check box is ticked. (all customers dont get a discount they dont need to see that we offer it to some because thats not nice). :-P

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Ah - I actually meant the report. Ooops.

    But it said it was invalid? I've just tested (take nothing for granted...) and my report was quite happy to base the visibility (in the on open event) of a control on the value of a form control (whether the value was text or numeric). You don't close the form before the report is opened? Perhaps post your code?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  7. #7
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    Are you saying that you have a box on your Report and is has borders that can be seen.

    If so, then what about again if the label for your Your Discount is the product of an IIF and when discount is $0 then the the writing changes to Extra Charges and that will show $0

    Mike

  8. #8
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    JS,

    If you have a CheckBox in your form and a TextBox that coincides with it, create your report, pull both fields into it, on the CheckBox properties set it's Visible properties to NO. On the TextBox associated with that CheckBox, go to it's properties FormatTab and set Visible to YES. Then on the DataTab click the ControlSource for it and input this in it:

    ...just for example...CheckBox name is CREDIT, TextBox name is tCREDIT, then place this in the ControlSource:

    =IIF([CREDIT]=True,"CREDIT","")

    Then when the CheckBox is checked, True/ -1 / Yes, your TextBox will spring to life and have the word CREDIT in it, but if the CheckBox is empty it doesn't come to life and not seen at all.

    have a nice one,
    Bud
    this Bud's for you....

  9. #9
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    That is a cool Idea :-P but I would rather it just dissappear. Thanks though.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  10. #10
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Thanks Bud but I need it to have the value that the user input in the form. Like someone clicks the checkbox and then from there inputs 398.89. I need that to show up in the report.

    JS

    Quote Originally Posted by Bud
    JS,

    If you have a CheckBox in your form and a TextBox that coincides with it, create your report, pull both fields into it, on the CheckBox properties set it's Visible properties to NO. On the TextBox associated with that CheckBox, go to it's properties FormatTab and set Visible to YES. Then on the DataTab click the ControlSource for it and input this in it:

    ...just for example...CheckBox name is CREDIT, TextBox name is tCREDIT, then place this in the ControlSource:

    =IIF([CREDIT]=True,"CREDIT","")

    Then when the CheckBox is checked, True/ -1 / Yes, your TextBox will spring to life and have the word CREDIT in it, but if the CheckBox is empty it doesn't come to life and not seen at all.

    have a nice one,
    Bud
    this Bud's for you....
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  11. #11
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Quote Originally Posted by pootle flump
    Hi JS

    So there will only be a value in the text box to the right if the two check boxes on the form are ticked? Then in the form OnLoad event would

    If forms!YourForm!RightTextBox >0 Then
    'choose the appropriate option below
    Me.discount.visible = false
    Me.discount = ""
    End If
    do the job?

    So what your saying is that when this report opens I need to have my form open still?

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  12. #12
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557

    Bump... Visible = False on report

    Geeze this isnt turning out too well. I have tried the code provided above and nothing has happened. It gives me an error :-/. Actually when I put it in the form code to open the report it no longer gave me an error, but it didnt do what it was supposed to. (which is hide the textboxes on the report because the form had a check box unchecked).

    JS Please help!
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  13. #13
    Join Date
    Apr 2004
    Location
    Sydney Australia
    Posts
    369
    Quote Originally Posted by JSThePatriot
    Geeze this isnt turning out too well. I have tried the code provided above and nothing has happened. It gives me an error :-/. Actually when I put it in the form code to open the report it no longer gave me an error, but it didnt do what it was supposed to. (which is hide the textboxes on the report because the form had a check box unchecked).

    JS Please help!
    Unless you have already done it why not first test things with SetValue macro on your form and run it from OnClick on a label or textbox.

    OpenReport
    SetValue
    Item [Reports]![YourReport]![Discount].Visible
    Expression No
    PrintOut.

    The if that works see if it work on your chosen event. But use a macro first up.

    Mike

  14. #14
    Join Date
    Mar 2004
    Location
    Nashville, TN
    Posts
    557
    Quote Originally Posted by Mike375
    Unless you have already done it why not first test things with SetValue macro on your form and run it from OnClick on a label or textbox.

    OpenReport
    SetValue
    Item [Reports]![YourReport]![Discount].Visible
    Expression No
    PrintOut.

    The if that works see if it work on your chosen event. But use a macro first up.

    Mike

    Thanks a million I didnt try it in the macro first but I just put it in the form similar to the way you had it. Here is my code:

    Code:
    Private Sub cmdVReport_Click()
    On Error GoTo cmdVReport_Err
        DoCmd.OpenReport "SalesOrder", acViewPreview, , , acWindowNormal
        If Discount.Value = 0 Then
        [Reports]![SalesOrder]![DAmount].Visible = False
        End If
        
    cmdVReport_Exit:
        Exit Sub
    
    cmdVReport_Err:
        MsgBox Err.Description
        Resume cmdVReport_Exit
    End Sub
    I hope this helps someone else

    Thank you everyone for this.

    JS
    Have you ever thought about thinking on purpose?

    Jarvis Stubblefield
    Patriot Designs
    Web/Database Development and Consulting
    The-Patriot.net by Patriot Designs

  15. #15
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    JS...

    Look below, I did up a sample DB for you. Look behind it and see what all I did. Short and simple. Hope this makes your day.

    Bud
    Attached Files Attached Files

Posting Permissions

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