May be there is already solution for it on web but but could not find it.
Looking for exact match of "ESC" key in vba
Reason:
I am facing two problems on my form.
My form has combo box with listed items.
This field in table is set to "required" and "Numbered", because its source is from another table and has enforced referential integrity.
Problem# 1
If someone enters words, which are not in combo list, then the user gets stuck. Can not udo it.
Error message received is "text you entered is not in the item list" "select an item which in the list......" I agree with this, yes this has to be, but the problem now the person is stuck.
I tried a click button with
1) Me.undo
2) by default access undo button macros, also tried
3) SendKeys "{esc}", True
4) DoCmd.RunCommand acCmdUndo
5) Me.Field1.value = Null , or Empty or "" etc
all of them wont work.
Only "ESC" key from keyboard works.
Backspace also works from keyboard, but with this I have another problem#2.
Problem#2
With backspace (keyboard) words are deleted, now user gets stuck at an error "You must enter the value in table field........." because it is required.
Now user can not close the form, can not undo and just stuck here.
How can these two problems be solved? Thanks
Looking for exact match of "ESC" key in vba
Reason:
I am facing two problems on my form.
My form has combo box with listed items.
This field in table is set to "required" and "Numbered", because its source is from another table and has enforced referential integrity.
Problem# 1
If someone enters words, which are not in combo list, then the user gets stuck. Can not udo it.
Error message received is "text you entered is not in the item list" "select an item which in the list......" I agree with this, yes this has to be, but the problem now the person is stuck.
I tried a click button with
1) Me.undo
2) by default access undo button macros, also tried
3) SendKeys "{esc}", True
4) DoCmd.RunCommand acCmdUndo
5) Me.Field1.value = Null , or Empty or "" etc
all of them wont work.
Only "ESC" key from keyboard works.
Backspace also works from keyboard, but with this I have another problem#2.
Problem#2
With backspace (keyboard) words are deleted, now user gets stuck at an error "You must enter the value in table field........." because it is required.
Now user can not close the form, can not undo and just stuck here.
How can these two problems be solved? Thanks
Last edited: