Update Field Based on Value Selected

spudracer

Here and there
Local time
Today, 15:38
Joined
Jul 1, 2008
Messages
199
I've got a form, with an option group.

What I'm trying to do is update a particular date based on whichever value is selected. If the value = 1, it shouldn't do anything, but if the value = 2, then it should return next year's date.

I've tried implementing this code, but for some reason, it's just not working right.

Any quick coders out there willing to help?
 
Are slow coders eligible to reply? :D

( by the way, posting the code you have might be easier than trying to do it all up from scratch)
 
Are slow coders eligible to reply? :D

But of course.

Here's what I have, but keep in mind, I'm no expert.

Code:
If Me.Report_Status.Value = 2 Then Me.Closeout_of_Last_Report = Me.CODLR
Else Me.Closeout_of_Last_Report = Me.CODLR
End If

This is my first attempt at writing code from scratch. Be gentle.
 
So, if the names are as shown (with the underscores) then it looks almost there. I am assuming that Me.CODLR is a date field?

If so, then -

Code:
If Me.Report_Status.Value = 2 Then 
   Me.Closeout_of_Last_Report = DateAdd("yyyy", 1, Me.CODLR)
Else 
   Me.Closeout_of_Last_Report = Me.CODLR
End If
 

Users who are viewing this thread

Back
Top Bottom