Lady_Dee said:
After entering date in one field, I need another field to reflect the end of
the month that I attached the update expression to. example, if I enter
3/10/09 in the field, I want the other field to automatically enter 3/31/09
in the field .
You could use the DateSerial to determine the first day of the next
month and subtract one day from that. Here's a function to do that
for you:
Public Function lastDayOfMonth(ByVal pdteIn As Date) As Date
lastDayOfMonth = DateSerial(Year(pdteIn), _
Month(pdteIn), 1) - 1
End Function
Then in the AfterUpdate event of OneField, you can say:
Me.OtherField = lastDayOfMonth(Me.OneField)
However, could OneField ever be Null after update? (That
function will cause an error, "Invalid use of null.") What
would you want to happen in that situation?
I doubt you need to store the calculated value for
OtherField in a table. Just calculate it whenever you
need it.