Write_event problem

  • Thread starter Thread starter sparkle_guy
  • Start date Start date
S

sparkle_guy

I have a form that when the write event is triggered (i.e. before "save" or
"save as" actions) some code is run. However the code also runs when the
form is sent. I have set the "save copy of sent messages" in properties to
off but the code still runs when the form is sent as well as when it is
subsequently saved. Any ideas what is going on or how to stop it.

Thanks Paul
 
You need to coordinate between the two events with a module-level flag:

Dim m_blnSent ' Boolean

Function Item_Send()
m_blnSent = True
End Function

Function Item_Write()
If Not m_blnSent Then
' do stuff with Item
End If
End Function
 
Back
Top