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 March 30th, 2013, 08:34 PM
Registered User
Join Date: Mar 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calculate data field from another table

Hi there,

I have an main table where i put my contrat details, such as:

Sale Date
End Contract Date
Type of product
Renew Date

This "Renew Date" depends on the number of months that i put on another table. The "Type of product" is linked to another table, where i define the "Group of Products". The number of months is writen here, by Group of Products.

So, the Renew Date is calculated on the number of months of Group of Product before the "End Contract Date".

I've tried this with Query and it works.

But i need to put this directly on the Table where i have the contracts.

There's a way to put this on Expression Builder?

Regards in advance...
Old August 23rd, 2013, 11:01 AM
Registered User
Join Date: Nov 2012
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default contact form

make the entry form from a query of the contract and the product
with the link between them being the key field.

then after you type the product in , it will cleverly look itself up and find the months for that product.

then you have an after update event on that field.
then you write code like this
me.renew_date = 0
x = Val(Me.months * 30) + now()
me.renew_Date = x

there may be minor flaws in whats here but thats basically it.
i did a test with numbers rather than dates , so that could be slightly different.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate age from a varchar birthdate field nuttylife2 SQL Server 2000 15 April 18th, 2016 10:56 AM
Table and field design for a 3 axis set of data rmccafferty Access 1 August 23rd, 2013 11:13 AM
dropdownlist field connected to table data not working oruckenan .NET 4 and Visual Studio 2010 General Discussions 2 August 12th, 2011 05:46 PM
Retrieve different data from same table /field W052107 Visual Studio 2005 7 August 6th, 2007 10:40 AM
calculate value on Lost Focus of text field creative_eye General .NET 1 April 12th, 2004 08:35 AM

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