zyus said:
What i'm expecting is to get new date as follow
Assume [fstrlsedt] = "01-01-2010" and [prd]=12
my new date will be "01-01-2011"
I have a date field [fstrlsedt] and a number field [prd].
[quoted text clipped - 10 lines]
Awfully descriptive control names... I hope you never give someone your
database to work on...
As George pointed out... clearly, you haven't tried it... where did you
intend to put this new date? What did you need to do with it?
If you need to be able to search for it, you have to add it to the form's
underlying recordsource (by creating a query based on the original
recordsource and then adding the expression to the query). Then you can
search for/sort by it.
If you just need to *display* it, then you can just create an unbound control
and set the controlsource.
If you have to create another record, that's a different story... I guess I'd
use DBEngine(0)(0).Execute and create a dynamic SQL string to do it...
Oh, and while you're at it, those field names really need some work - unless
you are the only one to ever work on this database. It's just a lot easier
to figure out after a long time away if the field and control names actually
make some kind of sense.
--
Message posted via AccessMonster.com
.