Marshall Brooks
Member
- Local time
- Yesterday, 19:14
- Joined
- Feb 28, 2023
- Messages
- 696
Hopefully this will take longer to explain than to solve ...
I have a field on my form named "Status" The form has drop-down values and the values are locked. So for example, on of the values is "Complete" and if someone types something like "AY" there is a message that than is not on the list and to choose a value from the list.
When "Complete" is selected, the Sub Status_AfterUpdate() generates several E-mails.
Because I couldn't find a better way to apply Sensitivity labels, the E-mail code uses SendKeys to set the label: https://stackoverflow.com/questions/72230105/changing-sensitivitylabel-in-outlook-365-email-with-vba
Obviously kludgey, but the database creates the E-mail and sends Alt-H, followed by "AY", followed by Arrows, followed by Enter.
Usually, it works, sometimes it sends the code to the database, which means the status field gets Changed to "AY" and then gets Enter, which results in the pop-up to select a value from the list.
Is there anywhere I can add code so that if the value of the field is AY, to use the previous value?
Is it as simple as adding a check to the BeforeUpdate procedure?
The record is not saved, so the "Complete" is the pending value but not the current value, but that is what I want the field to remain as.
Thanks in advance.
I have a field on my form named "Status" The form has drop-down values and the values are locked. So for example, on of the values is "Complete" and if someone types something like "AY" there is a message that than is not on the list and to choose a value from the list.
When "Complete" is selected, the Sub Status_AfterUpdate() generates several E-mails.
Because I couldn't find a better way to apply Sensitivity labels, the E-mail code uses SendKeys to set the label: https://stackoverflow.com/questions/72230105/changing-sensitivitylabel-in-outlook-365-email-with-vba
Obviously kludgey, but the database creates the E-mail and sends Alt-H, followed by "AY", followed by Arrows, followed by Enter.
Usually, it works, sometimes it sends the code to the database, which means the status field gets Changed to "AY" and then gets Enter, which results in the pop-up to select a value from the list.
Is there anywhere I can add code so that if the value of the field is AY, to use the previous value?
Is it as simple as adding a check to the BeforeUpdate procedure?
The record is not saved, so the "Complete" is the pending value but not the current value, but that is what I want the field to remain as.
Thanks in advance.