Query Date

  • Thread starter Thread starter Robb
  • Start date Start date
R

Robb

I understand how to do a future date calculation on a
form since I can't get the form date to update the query I
want to make the query do the date calculation, as of now
it only shows the future date calculation on the form.
Example on my form I have a [Granted] date and I need to
add 108 months to this to get a result for [PR Due] date.
Please help
 
Well if PR DUE is always 108 months after Granted, then I probably would not
store it at all, since it can always be calculated and you wouldn't need to
worry about missing an update on the PR DUE field whenever Granted was edited,
added, or deleted.

You can do this on the form, by using a control bound to the PR DUE field and
updating the value of the control whenever you change the value of Granted. Use
the after Update value of Granted to set the bound control to the new value.
Assuming your controls on the form are txtPrDue and txtGranted, the code would
look like:

If IsNull(txtGranted) Then
Me.txtPrDue = Null
Else
Me.txtPrDue = DateAdd("m",108,me.txtGranted)
End If

As I said, you probably would be better off just calculating the value when it
is needed.
 
Back
Top