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

Last Date Modified 2

Status
Not open for further replies.

Elvis72

Technical User
Dec 6, 2007
211
US
OK, I have searched and searched, while I have found helpful posts I can't find one that hits home with what my end goal is.

I have a Main Form, then I have multiple SubForms, I need to have a field on the Main Form that shows the date something on the Main Form or Subforms was last updated.

I can't seem to find something that would recognize when the subforms were changed?

Whatever information you need please let me know!~

Thanks so much!~

 
There are no event procedures on the form its self.

 
I will need to spend some time stripping the database of table information, as soon as I can get that done I will post again.
 
There is no need to do that, just copy the troublesome form to a fresh database and zip that, do not include any tables, they are not necessary.
 
Well, I did this but I have no idea where to post it?

 
There is a link below the posting box:

Need File Storage?
Upload to box.net
 
Well, the powers that be governing where I can and can't go at work will not let me go there.

I will post it tonight when I get home!~

Thanks so much!~
 
My fault, you need the Before Update event:

Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
    Me.Parent.txtLastUpdate = Now()
End Sub
 

Hi Remou,

Sorry for interupting, but i followed this thread - and I can't imagine, why should the 'After Update' event trow an error about a macro called '.'???
and why is the 'Before Update' better???

I would very appreciate if somebody could explain this...

Thanks, Ja

 
Good Morning -

When I move the code to the Before Update Event, and I make an edit in a text field I get this:

Run-time error '-2147352567 (80020009

You can't assugn a value to this object.

This is what I did:

Private Sub Form_BeforeUpdate(Cancel As Integer)
[highlight]Me.Parent.txtLastUpdate = Now()[/highlight]
End Sub

And I'm still getting the Can't Find '.' Macro error when I add a record to the Notes subform?


 
Hi Ja
You are right and I am due for the mad-house.

Elvis72
The only way I could get this to work was to cut-and-paste the whole tabcontrol with the subforms into a new form. Decompile did not work, a new db did not work, deleting code did not work, so there you are.

I think I need a rest. :(
 
WooooHoooo!~

Any reason it had to be in a different form? Just curious, try to avoid next time?

Thanks sooo very much!~

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top