I have a form that EMails a report. I need to be able to determine if the OK or Cancel button has been clicked. I have used (lastkey(0)) to get the last key press but it always returns the [Enter] key. Is there a way to find the last key pressed ?
I need a way to know if the email was sent or not sent. Perhaps there is an undocumented variable ? Here is my code which always sends the email; print REPORTNAME whe InspectId=.vInspectId + order by InvBuildId,InvFixtureTypeId,FixtureId + option PDF + |FILENAME .vFileSpec + |EMAIL ON + |EMAIL_AUTHENTICATION &vEM_Authentication + |EMAIL_HOST &vEM_HostName + |EMAIL_PORT &vEM_SMTP_Port + |EMAIL_USERID &vEM_UserID_EMailAddress + |EMAIL_PASSWORD &vEM_User_PW + |EMAIL_FROM_ADDRESS &vEM_From_EMail + |EMAIL_TO_LIST &veMailTo + |EMAIL_FROM_NAME &vEM_From_Name + |EMAIL_SUBJECT &vSubject + |EMAIL_BODY &vBody2 + |EMAIL_ATTACHMENTS &vfiletosend + |EMAIL_DELETE_AFTER_SEND OFF + |EMAIL_SHOW_DIALOG ON set v vlastkey=(lastkey(0)) if vlastkey='[enter]' the goto goodemail endi if vlastkey='[esc]' the goto bademail endi Any help would be appreciated. Bill Eyring

