|
From: theintern on 1 Jul 2008 15:09 I have a form which acquires info from the user, including a date. I would like to put another spot on the form, invisible to the user, which would be two work days prior to that day. later on i use this date in tables which are auto-linked to the form. i'm trying to use visual basic, with something to the effect of Private Sub Deadline_AfterUpdate() Me.Deadline = Me.BidDate - 2 End Sub but that is just a guess based on the other code I was given. The syntax could be way off. thanks scott
From: Klatuu on 1 Jul 2008 15:52 Your code would be correct; however, it should not be stored in a table. It is a calculated value based on a value you already have stored. The correct thing to do is to use the calculation where ever you need the value. -- Dave Hargis, Microsoft Access MVP "theintern" wrote: > I have a form which acquires info from the user, including a date. I would > like to put another spot on the form, invisible to the user, which would be > two work days prior to that day. later on i use this date in tables which > are auto-linked to the form. i'm trying to use visual basic, with something > to the effect of > > Private Sub Deadline_AfterUpdate() > Me.Deadline = Me.BidDate - 2 > End Sub > > but that is just a guess based on the other code I was given. The syntax > could be way off. > > thanks > scott
From: theintern on 1 Jul 2008 15:55 As in have it calculated within the table? If i insert a new column, called "Deadline" how do i get that to be two workdays previous to the existing column "Bid date", also in that table. thanks scott "Klatuu" wrote: > Your code would be correct; however, it should not be stored in a table. It > is a calculated value based on a value you already have stored. The correct > thing to do is to use the calculation where ever you need the value. > -- > Dave Hargis, Microsoft Access MVP > > > "theintern" wrote: > > > I have a form which acquires info from the user, including a date. I would > > like to put another spot on the form, invisible to the user, which would be > > two work days prior to that day. later on i use this date in tables which > > are auto-linked to the form. i'm trying to use visual basic, with something > > to the effect of > > > > Private Sub Deadline_AfterUpdate() > > Me.Deadline = Me.BidDate - 2 > > End Sub > > > > but that is just a guess based on the other code I was given. The syntax > > could be way off. > > > > thanks > > scott
From: Klatuu on 1 Jul 2008 16:02 What I am saying is that you do not put it in the table. It is a calculated value. You do not store calculated values in tables. You perform the calculation when you need the value. -- Dave Hargis, Microsoft Access MVP "theintern" wrote: > As in have it calculated within the table? If i insert a new column, called > "Deadline" how do i get that to be two workdays previous to the existing > column "Bid date", also in that table. > > thanks > scott > > "Klatuu" wrote: > > > Your code would be correct; however, it should not be stored in a table. It > > is a calculated value based on a value you already have stored. The correct > > thing to do is to use the calculation where ever you need the value. > > -- > > Dave Hargis, Microsoft Access MVP > > > > > > "theintern" wrote: > > > > > I have a form which acquires info from the user, including a date. I would > > > like to put another spot on the form, invisible to the user, which would be > > > two work days prior to that day. later on i use this date in tables which > > > are auto-linked to the form. i'm trying to use visual basic, with something > > > to the effect of > > > > > > Private Sub Deadline_AfterUpdate() > > > Me.Deadline = Me.BidDate - 2 > > > End Sub > > > > > > but that is just a guess based on the other code I was given. The syntax > > > could be way off. > > > > > > thanks > > > scott
From: theintern on 1 Jul 2008 16:21
Big picture: User inputs info, including bid date in Access, which stores it in a database. Through a series of steps that database ends up in Project. I need, as a deadline for Project, the date 2 working days prior to the bid date. It needs to be autocalculated, and it has to happen prior to being in Project, i.e. while in Access. So is there a way to autocalc one date from another, either in a table or a form, less 2 working days? thanks scott "Klatuu" wrote: > What I am saying is that you do not put it in the table. > It is a calculated value. You do not store calculated values in tables. > You perform the calculation when you need the value. > -- > Dave Hargis, Microsoft Access MVP > > > "theintern" wrote: > > > As in have it calculated within the table? If i insert a new column, called > > "Deadline" how do i get that to be two workdays previous to the existing > > column "Bid date", also in that table. > > > > thanks > > scott > > > > "Klatuu" wrote: > > > > > Your code would be correct; however, it should not be stored in a table. It > > > is a calculated value based on a value you already have stored. The correct > > > thing to do is to use the calculation where ever you need the value. > > > -- > > > Dave Hargis, Microsoft Access MVP > > > > > > > > > "theintern" wrote: > > > > > > > I have a form which acquires info from the user, including a date. I would > > > > like to put another spot on the form, invisible to the user, which would be > > > > two work days prior to that day. later on i use this date in tables which > > > > are auto-linked to the form. i'm trying to use visual basic, with something > > > > to the effect of > > > > > > > > Private Sub Deadline_AfterUpdate() > > > > Me.Deadline = Me.BidDate - 2 > > > > End Sub > > > > > > > > but that is just a guess based on the other code I was given. The syntax > > > > could be way off. > > > > > > > > thanks > > > > scott |