Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

Incrementing Dates

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bernard Murphy - 20 Oct 2005 09:54 GMT
I have two fields - StartDate & EndDate.

Is there any way via a form by which I can insert the Start date and have
the EndDate field in the table
automatically updated??
I do apprerciate that the EndDate does automatically update on the form but
how to get it to transfer to the table??

Many thanks

Bernard
Arvin Meyer [MVP] - 20 Oct 2005 11:35 GMT
If the end date is calculable, you do not need to store it in the database.
Use a query to calculate it each time you need to display it and base your
form or report on the query instead of the table. If you can't calulate it,
you do need to store it in the table.
Signature

Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

> I have two fields - StartDate & EndDate.
>
[quoted text clipped - 7 lines]
>
> Bernard
Bernard Murphy - 20 Oct 2005 12:21 GMT
Thanks indeed....yes I do know how to calculate in a form and/or query.

Do I take it therefore that there is no way by which inputting calculated
data via a form can be transferred
to the original database table?

Many thanks for your reply.

Bernard

> If the end date is calculable, you do not need to store it in the
> database.
[quoted text clipped - 14 lines]
>>
>> Bernard
Douglas J Steele - 20 Oct 2005 13:07 GMT
The issue isn't whether or not it's possible to store them (it is). The
issue is whether or not you should store them (you shouldn't).

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Thanks indeed....yes I do know how to calculate in a form and/or query.
>
[quoted text clipped - 24 lines]
> >>
> >> Bernard
Bernard Murphy - 20 Oct 2005 23:17 GMT
Thanks I accept that although I am not clear as to why one shouldn't.
How is it possible then to store in the table via the form?

Thanks for all the assistance.

Bernard
> The issue isn't whether or not it's possible to store them (it is). The
> issue is whether or not you should store them (you shouldn't).
[quoted text clipped - 30 lines]
>> >>
>> >> Bernard
Douglas J. Steele - 21 Oct 2005 00:25 GMT
As fellow Access MVP John Vinson likes to say "Storing calculated data
generally accomplishes only three things: it wastes disk space, it wastes
time (a disk fetch is much slower than almost any reasonable calculation),
and it risks data validity, since once it's stored in a table either the
Total or one of the fields that goes into the total may be changed, making
the value WRONG."

One approach for "how" is to have 2 fields on the form: one visible, and one
hidden. Bind the hidden field to the appropriate field in the form. In the
form's BeforeUpdate event, put code to transfer the value that's in the
visible field to the hidden field.

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Thanks I accept that although I am not clear as to why one shouldn't.
> How is it possible then to store in the table via the form?
[quoted text clipped - 38 lines]
>>> >>
>>> >> Bernard
Arvin Meyer [MVP] - 21 Oct 2005 03:42 GMT
In addition to Doug's method, you can write a few lines of code that check
for  the existence of the other elements of the calculation then fills the
the calculation in the bound text box.

If Not IsNull(Me.txtField1) Then
   Me.txtField3 = Me.txtField2 * Me.txtField1
End If

Doug already told you why not to. Good database design is important for a
smoothly running application.
Signature

Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

> Thanks I accept that although I am not clear as to why one shouldn't.
> How is it possible then to store in the table via the form?
[quoted text clipped - 36 lines]
> >> >>
> >> >> Bernard
Bernard Murphy - 22 Oct 2005 09:16 GMT
Thanks very much ......that explains the entire position very well.

Thanks again to all

Bernard
> In addition to Doug's method, you can write a few lines of code that check
> for  the existence of the other elements of the calculation then fills the
[quoted text clipped - 51 lines]
>> >> >>
>> >> >> Bernard
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.