Access

  52MikeH 21:41 08 Aug 2005
Locked

Can anyone help ?
I have a form and sub form linked with primary key.Main form has a field with a number enterd into it(IE 20)
Then the sub form has field which when there are multiple entries sums these entries, going back to the main form I have a second field that calculated the difference between the two figures in each form.
This all works perfect, but the calculated figure in the first form does not appear in it's Table.
Can anyone tell me why this is ?

Thanks
Mike

  madPentium 21:52 09 Aug 2005

I dont believe calculated fields are actually in the table because they are not fixed.

  52MikeH 07:19 10 Aug 2005

Do you know how I can get this Calculated field from the form to a report ?

Thanks

Mike

  ggudge 14:33 10 Aug 2005

Mike
If you are running the report whilst the form is open you can create the field in your report by using the query builder in properties against the record source and then add to your report. The new field will be something like this :- NewField:[Forms]![YourFormName]![YourObjectName]
This will only work if the form is open when you run the report.
To run without the form open you will have to build in the same calculations you used in the form.

  52MikeH 22:24 10 Aug 2005

ggudge,
I have tried this but the report only returns the value from the first record in the form.
Is there any way to create a report from a form ?

Mike

  ggudge 23:26 10 Aug 2005

Mike, Look at your criteria when selecting record, you should be getting all records if you have not set a criteria. To create a report from a form right click the form in database view and select save as a report. The form is retained and the report is created.

  ggudge 23:39 10 Aug 2005

Mike, Have a look at this website for really good tutorials click here

  52MikeH 07:30 11 Aug 2005

ggudge,
Thanks for your help
Mike.

  ggudge 07:44 11 Aug 2005

Mike, To force your report to view the same record as your form make sure the primary key is displayed on the form. Go back into your report and set the criteria for the primary key to [Forms]![YourFormName]![YourPrimaryKeyObject]. This should make your report perform correctly. Amazing what a good night sleep does for the little grey cells.

  52MikeH 19:00 13 Aug 2005

ggudge,
I have success !
I have a nice looking report, however I have noticed another problem.
Since the report is produced from the form it includes zero's which I do not want.
How can I filter these out ?
I have tried to filter with the following code
Me.Filter ="Text22" = "0"
Me.FilterOn = True

But this only me a blank report,Text22 is the name on the Second calculated field.

Mike

  52MikeH 07:56 14 Aug 2005

Anyone have any ideas ?

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

HP Envy x2 review: Hands-on

How Sketch and InVision have revolutionised our design workflow

The best tech gifts for Christmas 2017

Les meilleurs jeux de société (2017)