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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateAdd & Forms-Code is causing the dates to leave form 1

Status
Not open for further replies.

Kallen

MIS
Aug 14, 2001
80
US
Sorry to post a new thread on this. I posted one yesterday and it somehow dissapeared (another subject for another day)

What I wrote yesterday was that I needed code for the DateAdd function for two fields (1.Last FYE 2.Next FYE)

LDG1234 & Paul F gave me some helpful advice on how to accomplish this.

Method One:
Private Sub LastFYE_AfterUpdate()
Me.NextFYE = Me.LastFYE + 365
End Sub

Method Two:
Private Sub LastFYE_AfterUpdate ()
NextFYE=DateAdd("yyyy",1,LastFYE)
End Sub

When using both methods, I tried to test whether or not it worked. When I entered a date into the Last FYE, nothing appeared on the next FYE. In fact, the date on the last FYE dissapeared completly.

Does anyone know what I am doing wrong.

Thanks
 
I've tried the second method

Method Two:
Private Sub LastFYE_AfterUpdate ()
NextFYE=DateAdd("yyyy",1,LastFYE)
End Sub


e.g.Using the form

Entered 29/02/04 in LastFYE
28/02/05 appears in NextFYE


Are LastFYE and NextFYE correctly named.

?? Is this your lost post

thread181-123603
 
Yes it is spelled correctly, that's why I am really stumped.

I am going to look at it again and try and figure it out. I know it's something I am doing and it's driving me nuts!

Thanks, if I still can't figure it out I gues I will post another message.

I have confidence though!!
 
Oh and by the way

Thanks for finding my thread!
 
Are these fields bound to a table? If so, can you see if the values are stored there? I had a situation once where the values seemed to be disappering and I found I needed to re-size the text box and re-align the font.

Just a thought. ljprodev@yahoo.com
ProDev, MS Access Applications B-)
 
Yes these two fields are bound to a table. After my info. dissapeared, I went into both the table and the query (in which it should be stored) to check to see if they could be in there and they were not.

I will double check tonight when I get home. This data base in my night time project. During the day I am chained to Excel doing MIS reports!

Will let you know that status.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top