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

Update date on table

Status
Not open for further replies.

Bob500

Technical User
Aug 8, 2003
65
EU
Hi,

I have some code on the control surce of a textbox to automatically calculate a date from another textbox.

=DateAdd("y",+14,[date sent to])

It works but the calculated data isn't automatically put into the table, the cell just remains blank. How can I make it paste into the table or even put the code on the table itself?

Thanks :)
 
You don't mention how the code associated with your text box is 'triggered', but I suspect your problem might be that nothing is causing the code to run. You might want to look at putting the code against the first textbox, '[date sent to]', so that when that is updated, the code is run to populate the dependant textbox.

If this is barking up the wrong tree, then please accept my apologies.
 
the code is on a blank textbox and runs when a date is entered into another text box called 'date sent to'.

The calculated date is automatically entered into the forms textbox, but not onto the table. (Probably because I have put the code into the control source of the textbox?)

So I guess that the textbox is getting populated but not saved :/
 
It thought of putting this code on the on change event of the date sent to textbox.

dateexpected =DateAdd("y",+14,[date_sent_to])

It works, but only if you manually enter the date into the box. What i forgot to mention was that I am using a calendar to pick the date which automatically enters the selected date into the date sent box. If I do it this way the date expected does not update. Any ideas?
 
No worries, just got it.

I put the exact same code on the onclick event of my calenad and it works a treat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top