Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting information froman unbound Textbox (Access 2000)

    I was advised to learn Access through examples in the Northwind Database, which I did and learn't a lot from. I have a question which this doesn't seem to have an example and I can't find the answer through other sources.I use a Form with a few unbound Textboxes which calculate values from other bound Textboxes.I need to refer and SUM these values from the unbound Textboxes in a Report. Does anybody know if this can be done?

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting information froman unbound Textbox (Access 2000)

    You have to sum them manually in the source of the textbox of the report :
    = Cint(forms!frm!Name!text0) + Cint(forms!frm!Name!text1) + Cint(forms!frm!Name!text2) + ...

    Replace Cint with CLng, CSng or CDbl according the value you have to treat
    Francois

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Getting information froman unbound Textbox (Access 2000)

    The best and safest way to do this is to recreate the calculations in an expression contained in the query underlying your report. This way, you won't depend on the form being opened to when you run your report.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    New Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting information froman unbound Textbox (Access 2000)

    Hi Graham,

    This is how I would do it if I wanted the fields to be really unbound, with no underlying query:

    Create the required unbound textboxes in the form and save it. Create the report and add the destination "total" textbox. Right click on the the Control Source property for the "total" textbox and click on Build. This will open the Builder. You can then navigate to the form and select the fields you want to add or sum. The control source for the textbox should look like this:

    =[Forms]![SumValues]![Value1]+[Forms]![SumValues]![Value2]+[Forms]![SumValues]![Value3]

    or

    =Sum([Forms]![Value1.. and so on.

    I would then put a button on the form to open the report. If the report is opened without the form being opened, the total field will show and error.

    Hope this helps,

    Rob

Posting Permissions

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