Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 2nd, 2005, 06:44 PM
Registered User
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Real Time Calculations on Form

I need some help:

I have a form where employees document activities during their day. One field asks for the number of activities they performed which is stored in Table 1. In Table 2, I have costs associated with specific activities.

In my form, I want a box that takes the number of activities entered and multiplies it by the costs associated from table 2 and displays when the information is available.
Is this possible?
Thanks,
Jason

 
Old February 2nd, 2005, 06:59 PM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It sounds like you need to use a timer that would periodically re-run your query and repopulate the form. The timer could be set to fire every 10,000 milliseconds (every 10 seconds), or whatever suits your needs. If you decide to try this, be sure you disable the timer while you're refreshing the form, and reenable it when the refresh is done.

Pete
 
Old February 2nd, 2005, 07:05 PM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Is the record source for your form table 1 or table 2 or both?

 
Old February 2nd, 2005, 07:25 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

The other option is to code an event based on the number of activities field losing focus. In the event, call a function which updates the value for the control you need updating. I would be happy to elaborate if you would like.

Mike

Mike
EchoVue.com
 
Old February 2nd, 2005, 11:15 PM
Registered User
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the replies.

The number of activities is logged in Table 1. Table 1 and Table 2 have a relationship with the type of activity being the joining point. Table 2 has the cost info. I've tried doing a query with a sub-form but it displays all of the data in the query, not just the current calculation. I'm a self-taught access user with no formal coding experience.

Mike, can you elaborate? I'll also try the timer.

Thanks,
Jason

 
Old February 3rd, 2005, 10:39 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

I'll work on getting some code together for you, but I was wondering... Is it possible for an employee to be engaged in more than 1 different type of activity during the day, or is it a case of them being involved in 1 type of activity but having n number of times they completed it?

Thanks

Mike

Mike
EchoVue.com
 
Old February 3rd, 2005, 10:50 AM
Registered User
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is what I'm trying to do. I am a pharmacist and have created a form to document what other pharmacists do during the day.

One example: A pharmacist is asked to dose antibiotics for 4 different patients. On my form, they would select an option group of (Rx to Dose). This option group number is in Table 1. Table 1 is linked to Table 2 by the number in the option group. Table 2 has the cost savings for Rx to Dose.

Once the option group is selected, the pharmacist then inputs a number for Number of interventions of that type they performed. (which is stored in Table 1) I then want a real time calculation to show the pharmacist how much they saved with their intervention.

Essentially, taking the Number of Interventions(Table 1) * Cost Savings (Table 2) for that Intervention and displaying it on the form.

I hope that makes sense.
Thanks,
Jason
 
Old February 3rd, 2005, 10:54 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Makes sense to me! Last question for now - I am guessing that all this form is used for, is as an information source. Are you wanting to save any of the data, or just simply display the cost savings when the activity is entered?

Mike
EchoVue.com
 
Old February 3rd, 2005, 11:38 AM
Registered User
 
Join Date: Sep 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The form is a Data Entry form that saves in Table 1. I want to save all of the data that is entered. I can run a query to obtain the total cost savings for each intervention so saving that data is not a must. If I can save the data, that would be fine.

I really appreciate your help.
Jason

 
Old February 3rd, 2005, 01:53 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

This should be fairly simple to setup. I have a bunch of meetings I have to attend, but I hope to be able to get back to it later today or first thing tomorrow.

Mike

Mike
EchoVue.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Real time data from network Nuwang .NET Framework 2.0 1 May 13th, 2008 04:34 PM
time in sql server is not real time hertendreef SQL Server 2005 6 April 19th, 2007 07:07 AM
time calculations lizhaskin Access 1 November 10th, 2005 08:48 AM
Run Time Calculations angel_xpmx Classic ASP Databases 2 November 27th, 2004 05:32 AM
real time calculations jman11587 Javascript How-To 4 June 29th, 2003 07:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.