Solved

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

Posted on 2015-01-15
9
102 Views
Last Modified: 2015-01-15
How do you code or select a calculation field from one form to another??
0
Comment
Question by:Jass Saini
  • 6
  • 3
9 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40551755
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40551766
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
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 40551827
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
 

Author Comment

by:Jass Saini
ID: 40551845
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40551853
...then my first post should work...
0
 

Author Closing Comment

by:Jass Saini
ID: 40551925
Thanks
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40551968
;-)
0
 

Author Comment

by:Jass Saini
ID: 40551969
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 40552667
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now