Most of us consider spaces in field names to be a bad idea, but if you're
determined to keep them, try
Me![Date Last Updated] = Now()
--
Doug Steele, Microsoft Access MVP
(no private e-mails, please)
zufie said:
Thanks.
The users are using the security database to log in, (that is, using
ms-access security) so I want to use the id (Username) that they log
in with for tracking.
Here is the code, someone sent me, that they use:
Private Sub Form_Dirty(Cancel As Integer)
Me!USERNAME = CurrentUser()
Me!ROWLASTCHANGE = Now()
End Sub
I believe I must add a field names USERNAME to my Tbl Main ID to where
the values for USERNAME would be held??
I believe I must also replace ROWLASTCHANGE (in code above) with the
field name, Date Last Updated, that I already have in my Tbl Main ID??
Based on the field names I mentioned I changed the code to the
following:
Private Sub Form_Dirty(Cancel As Integer)
Me!USERNAME = CurrentUser()
Me!Date!Last!Updated = Now()
End Sub
But the line, Me!Date!Last!Updated = Now(), gives me a Run-time error
2465 Microsoft Office Access can't find the field 'Date' referred to
in your expression. How then, must I type my field name, Date Last
Updated in the code for the code to be correct??
P.S. I think the USERNAME portion of the code is working correctly,
it's just the ROWLASTCHANGE portion (Date Last Updated) that is not.
Thank you!!!
Zufie (John)