Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 110
  • Last Modified:

How to cover over a calculation field from one form to another

How do you code or select a calculation field from one form to another??
0
Jass Saini
Asked:
Jass Saini
  • 6
  • 3
1 Solution
 
Jeffrey CoachmanMIS LiasonCommented:
Lets presume a textbox named "txtCalc" on Form 1 has your calculation, and you need that same calculation in form 2, in a textbox names txtCalc2.

In form 2 make the control source of the textbox (txtCalc2):
=Forms!Form1!txtCalc
0
 
Jeffrey CoachmanMIS LiasonCommented:
The kicker here is that Form1 must always be open in order for this to work....

The better approach would be to create a function that does the calculation, ...then simply call he function on each form...
0
 
Jeffrey CoachmanMIS LiasonCommented:
A function could be used anywhere in your app. (on another form, a report, ...a query)
  (or be portable to another App)
a sample of a (Public) function is attached.
The other good thing is that if you use the function in a query, then you can use that query as the source for other forms and reports (and there may not be a need t reference the function again...)

;-)

JeffCoachman
Database52.mdb
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Jass SainiAuthor Commented:
Hello Jeff,

I understand that...but the fields are different for function...the end result on the form is what I need to capture on the next form.
0
 
Jeffrey CoachmanMIS LiasonCommented:
...then my first post should work...
0
 
Jass SainiAuthor Commented:
Thanks
0
 
Jeffrey CoachmanMIS LiasonCommented:
;-)
0
 
Jass SainiAuthor Commented:
Hello Jeff,

I looked at the DB and what is a Double?  I woul have to define all the fields that I need for that calcualtion?
0
 
Jeffrey CoachmanMIS LiasonCommented:
what is a Double?
You can look at the Access help files on "Field Size"
Field SizeBasically they are numbers that can be up to 15 decimals...
I picked that so that if you had decimals, ...calculated values could float the decimal.

I woul have to define all the fields that I need for that calcualtion?
Not sure what you mean, ...but any argument you supplied to the function would have to fit in the parameters of a double number...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now