Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 8th, 2003, 07:09 PM
Registered User
 
Join Date: Jun 2003
Location: Dartmouth, Nova Scotia, Canada.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Stever
Default Beginner

I have a table with 3 fields (columns). I have a form with 3 fields bound to the 3 fields in the table. I want field C calculate field B minus field C and return this value to the table. By using an expression as the control source I am able to make the calculation on the form but I am taking away the binding to the field in the table. How can I calculate this and still retain the binding to the field?
Reply With Quote
  #2 (permalink)  
Old June 9th, 2003, 12:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For starters, I wouldn't suggest having a field that is just calculated - you can just run a query that will automatically. With a query such as:

Code:
SELECT Field1, Field2, [Field1]-[Field2] AS Difference
FROM Table1;
If you want it displayed on the form, you can just have an unbound textbox with the control source being something along the lines of:

Code:
=[Field1]-[Field2]
Storing the difference of the two would just take up space.

HOWEVER, having said that
If, for some strange reason you REALLY REALLY need to have it stored, you could put some code into the form's BeforeUpdate event to calcutate the difference, or on some other event, such as the OnEnter event of the field.

HTH

Steven
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
c++ beginner, need help please jmarsh56 Visual C++ 0 December 7th, 2005 10:38 AM
Beginner Tilak_1 C# 2 January 21st, 2005 11:19 PM
Beginner c.j.rowell@ntlworld.com Beginning PHP 4 December 23rd, 2004 03:22 PM
Need help - C++ beginner Satheesh C++ Programming 13 August 7th, 2004 09:18 PM
Beginner programmed XML 3 February 21st, 2004 05:12 AM



All times are GMT -4. The time now is 03:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.