Date update upon modification

DarkProdigy

Registered User.
Local time
Today, 14:03
Joined
Jan 9, 2006
Messages
91
Hi all;
I know this thread has probably already been done but I've tried searching and nothing I've found seems to be what I'm looking for. What I want to do is incorporate an automatic Date update to a table, every time an item is updated in that table. I've tried creating a new field "DateLastModified" and puttin =Now() in as the default value, but this does not input a date into the field. Any suggestions on how I can get this to work?
 
I think I'm getting closer to the answer. I think I can figure out how to do it if I include the date field in my form for updating values, but I don't want this to be visible on the form. What i want is to only include updateable values on the form and have the date of modification updated behind the scenes on the table. Is this possible?
 
DarkProdigy said:
I think I'm getting closer to the answer. I think I can figure out how to do it if I include the date field in my form for updating values, but I don't want this to be visible on the form. What i want is to only include updateable values on the form and have the date of modification updated behind the scenes on the table. Is this possible?


Have you tried making that date box invisiable. That way it can't be seen by the user?
 
Still can't get it to work.

What I did was I made an invisible text box on the form and used my Date field as the control source. Then under Before Update I put the following code

me!DateModified = Date()
or
Me.DateModified = Date()

However, neither of thse work to input an entry into my DateModified field on the table
 
Still can't get it to work.

What I did was I made an invisible text box on the form and used my Date field as the control source. Then under Before Update I put the following code

me!DateModified = Date()
or
Me.DateModified = Date()

However, neither of thse work to input an entry into my DateModified field on the table
 
DarkProdigy said:
Still can't get it to work.

What I did was I made an invisible text box on the form and used my Date field as the control source. Then under Before Update I put the following code

me!DateModified = Date()
or
Me.DateModified = Date()

However, neither of thse work to input an entry into my DateModified field on the table

Is DateModified the name of your text box? If so try this.

me.DateModified.value = Now()

I'm not 100% sure, but it can't hurt to try.
 
nope, still nothing showing up in my table.

Maybe it has something to do with the way I set up my text box? What I did was in design view, I just put in an oridnary text box, then under properties I put the Control to DateModified, which is the field in the table I want to export the values into, then I did that Before Update code dealy.
 
DarkProdigy said:
nope, still nothing showing up in my table.

Maybe it has something to do with the way I set up my text box? What I did was in design view, I just put in an oridnary text box, then under properties I put the Control to DateModified, which is the field in the table I want to export the values into, then I did that Before Update code dealy.

This may require a record set, give me the name of the table. So I can try and write it for you.
 
The name of the table is "ProductionHrs".

It seems to me that this should be pretty easy. The date thing works properly when I create an entirely new record, but doesn't when I modify and existing one
 
DarkProdigy said:
The name of the table is "ProductionHrs".

It seems to me that this should be pretty easy. The date thing works properly when I create an entirely new record, but doesn't when I modify and existing one


Ok, BRB with you.
 
DarkProdigy said:
The name of the table is "ProductionHrs".

It seems to me that this should be pretty easy. The date thing works properly when I create an entirely new record, but doesn't when I modify and existing one

Ok, doll, I was able to get it to work on the before change event.

I placed

Code:
Me.productdate.Value = Now()

in the before change event for all the controls that are possible to be changed. It took effect once I lost focus of that control box.

No recordset was required.

I am attaching my copy of it. See if that helps.
 

Attachments

DarkProdigy said:
Still not working, although I really can't follow your example.

Well post yours and I can show you on yours.
 
Ok, I get what you're doing now. But what's with the button? Can it be done without that?
 
DarkProdigy said:
Ok, I get what you're doing now. But what's with the button? Can it be done without that?


Yeah, I should have removed it..sorry..
 
DarkProdigy said:
Ok, here is a simple example of what I'm trying to do

About to head out, I will take a look at it tonight.
:D
 
So I want it to update the DateModified field each time a value in the Hours field is modified through the form
 

Users who are viewing this thread

Back
Top Bottom