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!

Adding Dates

Status
Not open for further replies.

VBdevil

Programmer
Sep 19, 2002
75
IL
I have a form which I display in datasheet view, with a few fields, and one of the fields is a date field taken from a certain table (let's say fldDate1). What I want is to have a new field on the form (let's say fldDate2 which is unbound) that calculates [fldDate1 + 30 months] for each record, for each value of fldDate1.
I tried adding 30 months using the DateAdd function, and it worked great but only for the first value of fldDate1 (the first record). My problem is that I don't know how to traverse through all the records, and each time calculate the new date for fldDate1+30 months, according to the value of fldDate1.

It's probably a really simple solution, but I really couldn't think of anything, plus I'm kindof stressed on time...

Hope you guys understood my problem, If you need any other explanations, let me know.
 
Hi

If the field is unbound, set its recordsource to =DateAdd(fldDate1,"m",30), that should do it, no need to traverse thru records

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
It works!

I can't believe it - I'm sure I tried this solution, but for some reason it didn't work for me...
Probably didn't write it at the exact right place or something...
Thanks so much :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top