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

who changed the form for the last time?

Status
Not open for further replies.
Mar 27, 2002
168
NL
I have a field fldChange.
I have a table with users.
The initials of the users I want in this field everytime someone change the form.
How can I handle this?
I tried
Form_afterUpdate()
fldChange = Dlookup("[initials]","user", "[surname] = " & environ("username")).
end sub
write it by freehand so maybe mistakes in it, but this do not what I want, it changes everytime a user ONLY look at the form
Thnx in advance
Gerard
 
Try using the
Code:
Form_BeforeUpdate()
If Me.Dirty Then
construct.

.Dirty is only true when changes have been made.


'ope-that-'elps.

G LS
 
Nope,
the problem is, there are four tabpages on the form, the me.dirty also is true when jump to another tabpage

any other suggestions?
 
Do you want to log data changes or design changes to the form? For data changes S'mudge had the perfect solution above. Just have a LASTUPDATED field (date) and a LASTUPDATEBY field that holds username. Run this in Form_BeforeUpdate as shown above et voila.

My conjecture is that the me.dirty test isn't needed as there won't be an update if the buffer hasn't been dirtied (subject to correction).

*Tabbing to pages WON'T dirty the form.
[tt]
Form_AfterUpdate()

me.[LASTUPDATE] = Date()
me.[LATUPDATEBY] = UserNameFunction

End Sub[/tt]

For Design Changes: Don't let others do it. Period. Jeff Roberts
Analysis, Design, & Implementation
RenaissanceData.com
 
Please make that Before_Update[/] no endless loops needed here... Jeff Roberts
Analysis, Design, & Implementation
RenaissanceData.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top