troubleshooting Question

Function that refers to oldvalue and field name - is it possible

Avatar of Rob4077
Rob4077Flag for Australia asked on
Microsoft Access
6 Comments1 Solution513 ViewsLast Modified:
I would like to create a small function that will update a Memo field when values are changed but I am not sure how (or if it's possible) to carry a field's oldvalue and name into a function. The function I would like to write would need to be called by something like
fChangeLog(myFieldName)
and the function something like

Function fChangeLog(FieldName as Variant)
  If FieldName.value <> FieldName.oldvalue then
    me.History = Me.HistoryMe.History & vbNewLine & Me.LastEdited _
            & FieldName.Name & " changed from " & FieldName.OldValue _
            & " to " & FieldName.value
  Endif
End Function

Is there a way to get this working?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros