Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Annual Annual

Status
Not open for further replies.

greysquirl

Programmer
Jan 31, 2001
27
US
I am going to try and explain this the besy way I know how. . . . .

I have a form called Review. At the moment I have a bit of code running in the form (see below) which on January 1 of every year will clear out (4) text boxes and (3) check boxes. What I need to happen here is on January 1 of every year I need to add a year to TextAnnual. To make more sense of this let me explain. The form is to represent employee review dates starting at 3 months, 6 months and every year consecutively. The check boxes are to be checked as the reviews are done respectively. Every year on Jan 1 I need the form to add a year to TextAnnual and clear out the check boxes so that in my report it should show the employees who have reached their review dates.

Private Sub Form_Current()
If (Month(Date) = 1) And (Day(Date) = 1) Then
Me!TextPosStart = ""
Me!Text3Month = ""
Me!Text6Month = ""
Me!TextAnnual = ""
Me!Check1 = False
Me!Check2 = False
Me!Check3 = False
End If
End Sub


I hope I haven't confused anyone. If you can understand this please help. . . .

Thank you in advance for any help you can provide me with.
 
Me.TextAnnual = DateAdd("yyyy", 1, Me.TextAnnual)

Although this will add "one" to the year of A date in the text box (IF it is a DATE), it probably isn't the "real" soloution.

"We" don't have a CLUE about how/where ME.TextAnnual gets its value, or even what data type is "in" the control. "We" are not even absoloutly sure that Me.TextAnnual is - in FACT a textbox control. If we knew what ti is and where it is getting the info from, a better anser might be available.
MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Explain to me exactly what information you might need from me to get the proper gist of the situation and I will try to provide you with all I can.

I tried just simply putting this into the form and it did exactly what you said it would do. . . .add a year to the current date of the form, and uncheck the box that was there. What didn't happen is it did not reflect this date change in the table (Review) and it added a year every time I opened the form.

?????? I am confused; obviously. . . .please help

Private Sub Form_Current()
If (Month(Date) = 6) And (Day(Date) = 21) Then
Me!TextAnnual = DateAdd("yyyy", 1, Me!TextAnnual)
Me!Check3 = False
End If
End Sub
 
where ME.TextAnnual gets its value e.g. does it have a controlsource? Is it derived from other information? If so WHAT is that info and WHERE is it obtained from (table? query? Current date (Date | Now)?

From your reply, I would EXPECT that it is a value stored in a table (Currently = #1/1/2001#?). Next Jan 1 (#1/1/2002#) you want it to change.

The expression (whatever it is) might go into the If statement of your original post, but would probably look (more) like:

Me.TextAnnual = Format(Now, "Short Date")

This would change the value each time it proceddes the check-boxes, but would ALWAYS just make it the current year.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top