PC Review


Reply
Thread Tools Rate Thread

Date Modified/Time Stamp

 
 
Elvis72
Guest
Posts: n/a
 
      28th Jul 2008
I have a Main Form that has many subforms on it.

I need to see the last time the record was modified somewhere on the main
form.

I have seen how to make it where it is just a form, but if they go in and
modify a related subform then I need that to show up too.

Any questions or information needed please let me know!~
 
Reply With Quote
 
 
 
 
Stefan Hoffmann
Guest
Posts: n/a
 
      28th Jul 2008
hi,

Elvis72 wrote:
> I have seen how to make it where it is just a form, but if they go in and
> modify a related subform then I need that to show up too.

Add the timestamp field to each table. Use the Before Update event in
your subforms to set the timestamp.

Use a union query to get the history:

SELECT TableName, ID, Timestamp FROM
(
SELECT 'table1' AS TableName, ID, Timestamp FROM table1
UNION ALL
....
UNION ALL
SELECT 'tableN', ID, Timestamp FROM tableN
) Q
ORDER BY Timestamp

This might be overkill. In the case you don't need that much
information, just store the timestamp in your main table. Use the Before
Update event in your subforms to set the value in your main table, e.g.

SQL = "UPDATE mainTable SET timestamp = Now() WHERE Id = " & _
Me.Parent.Form![ID]
CurrentDb.Execute SQL, dbFailOnError


mfG
--> stefan <--
 
Reply With Quote
 
Klatuu
Guest
Posts: n/a
 
      28th Jul 2008
In the Form After Update event of each of your subforms:

Me.Parent.txtTimeStamp = Now

txtTimeStamp should be a control on the main form bound to the field in the
main form's recordset where you want to store the last updated value.
--
Dave Hargis, Microsoft Access MVP


"Elvis72" wrote:

> I have a Main Form that has many subforms on it.
>
> I need to see the last time the record was modified somewhere on the main
> form.
>
> I have seen how to make it where it is just a form, but if they go in and
> modify a related subform then I need that to show up too.
>
> Any questions or information needed please let me know!~

 
Reply With Quote
 
Elvis72
Guest
Posts: n/a
 
      29th Jul 2008
Klatuu -

I implemented your After Update and I am getting this message:

Microsoft Office Access Can't find the macro 'Me'

Which I'm not sure what it is looking for?

Here is what I have for the After Update:

Me.FrmConstructionServices - All Records.txtTimeStamp = Now



"Klatuu" wrote:

> In the Form After Update event of each of your subforms:
>
> Me.Parent.txtTimeStamp = Now
>
> txtTimeStamp should be a control on the main form bound to the field in the
> main form's recordset where you want to store the last updated value.
> --
> Dave Hargis, Microsoft Access MVP
>
>
> "Elvis72" wrote:
>
> > I have a Main Form that has many subforms on it.
> >
> > I need to see the last time the record was modified somewhere on the main
> > form.
> >
> > I have seen how to make it where it is just a form, but if they go in and
> > modify a related subform then I need that to show up too.
> >
> > Any questions or information needed please let me know!~

 
Reply With Quote
 
Klatuu
Guest
Posts: n/a
 
      29th Jul 2008
You are mixing syntax
Me.FrmConstructionServices - All Records.txtTimeStamp = Now

Me is a name that refers to the current form. It appears your form name is
FrmConstructionServices - All Records. If that is so, then to use a form
name with spaces in it, it has to be enclosed in brackets:
[FrmConstructionServices - All Records]

But, all you need is:
Me.txtTimeStamp = Now

That assumes FrmConstructionServices - All Records is the main form and the
code is in the main form module.

Now, to do your subforms, the correct syntax is
Me.Parent.txtTimeStamp = Now
--
Dave Hargis, Microsoft Access MVP


"Elvis72" wrote:

> Klatuu -
>
> I implemented your After Update and I am getting this message:
>
> Microsoft Office Access Can't find the macro 'Me'
>
> Which I'm not sure what it is looking for?
>
> Here is what I have for the After Update:
>
> Me.FrmConstructionServices - All Records.txtTimeStamp = Now
>
>
>
> "Klatuu" wrote:
>
> > In the Form After Update event of each of your subforms:
> >
> > Me.Parent.txtTimeStamp = Now
> >
> > txtTimeStamp should be a control on the main form bound to the field in the
> > main form's recordset where you want to store the last updated value.
> > --
> > Dave Hargis, Microsoft Access MVP
> >
> >
> > "Elvis72" wrote:
> >
> > > I have a Main Form that has many subforms on it.
> > >
> > > I need to see the last time the record was modified somewhere on the main
> > > form.
> > >
> > > I have seen how to make it where it is just a form, but if they go in and
> > > modify a related subform then I need that to show up too.
> > >
> > > Any questions or information needed please let me know!~

 
Reply With Quote
 
Elvis72
Guest
Posts: n/a
 
      30th Jul 2008
Klatuu -

I have tried the below in both the before and after update events, and I'm
getting the error can't find the '.' macro.

AND now I'm getting

Run-time error '-2147352567 (80020009

You can't assign a value to this object.

When editing a field.

"Klatuu" wrote:

> You are mixing syntax
> Me.FrmConstructionServices - All Records.txtTimeStamp = Now
>
> Me is a name that refers to the current form. It appears your form name is
> FrmConstructionServices - All Records. If that is so, then to use a form
> name with spaces in it, it has to be enclosed in brackets:
> [FrmConstructionServices - All Records]
>
> But, all you need is:
> Me.txtTimeStamp = Now
>
> That assumes FrmConstructionServices - All Records is the main form and the
> code is in the main form module.
>
> Now, to do your subforms, the correct syntax is
> Me.Parent.txtTimeStamp = Now
> --
> Dave Hargis, Microsoft Access MVP
>
>
> "Elvis72" wrote:
>
> > Klatuu -
> >
> > I implemented your After Update and I am getting this message:
> >
> > Microsoft Office Access Can't find the macro 'Me'
> >
> > Which I'm not sure what it is looking for?
> >
> > Here is what I have for the After Update:
> >
> > Me.FrmConstructionServices - All Records.txtTimeStamp = Now
> >
> >
> >
> > "Klatuu" wrote:
> >
> > > In the Form After Update event of each of your subforms:
> > >
> > > Me.Parent.txtTimeStamp = Now
> > >
> > > txtTimeStamp should be a control on the main form bound to the field in the
> > > main form's recordset where you want to store the last updated value.
> > > --
> > > Dave Hargis, Microsoft Access MVP
> > >
> > >
> > > "Elvis72" wrote:
> > >
> > > > I have a Main Form that has many subforms on it.
> > > >
> > > > I need to see the last time the record was modified somewhere on the main
> > > > form.
> > > >
> > > > I have seen how to make it where it is just a form, but if they go in and
> > > > modify a related subform then I need that to show up too.
> > > >
> > > > Any questions or information needed please let me know!~

 
Reply With Quote
 
Stefan Hoffmann
Guest
Posts: n/a
 
      30th Jul 2008
hi,


Elvis72 wrote:
> I have tried the below in both the before and after update events, and I'm
> getting the error can't find the '.' macro.

Yup, Klatuu answers is VBA code not a macro. So you need an event
procedure. If it still doesn't work, post your entire event procedure code.


mfG
--> stefan <--
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
update time stamp / date modified Eric Brown Windows XP General 3 28th Apr 2009 08:07 PM
Modified date time stamp notworking ...Help =?Utf-8?B?QUwgUmlvcw==?= Microsoft Access Form Coding 5 28th Jan 2007 04:54 PM
Time/Date Stamp for Row Modified =?Utf-8?B?c20=?= Microsoft Access Database Table Design 3 13th Dec 2005 06:33 AM
Date/Time stamp of new & modified records =?Utf-8?B?RGFycmVsbA==?= Microsoft Access Getting Started 8 12th Aug 2005 02:19 AM
Get file last modified date/time stamp bill Microsoft Access VBA Modules 2 25th Feb 2004 10:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:22 PM.