I’ve run out of ideas to fix this annoying issue and need your help. Autorefresh is turned off and there are no field initial focus settings enabled. I have a checkbox in the 3rd column of a table with an entering event that contains a prompt. The first and second column contain text only. Clicking anywhere to the left of the field seems to trigger the entering event causing the prompt to appear. How can I capture this to prevent the code from executing? I found a few posts but none with a solution.
Subject: Entering Event triggers outside of the field. How do I prevent this?
I set up a test using the following code and it does not execute until I click in the field.
Added to the entering event for the field:
result = Evaluate({@If(@IsMember(“[HR]”; @UserRoles))})
If result(0) = "0" Then
password = Inputbox("Please enter the Benefits Enrollment password","Password","")
'Here is where the password resides
'If Not password = "test" Then
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim docpassword As String
Set uidoc = ws.currentdocument
docpassword = uidoc.FieldGetText("password")
If Not password = docpassword Then
Call uidoc.Close
End If
End If
Subject: RE: Entering Event triggers outside of the field. How do I prevent this?
As I’m editing this document, I find that when I click to the left of the Subject field (e.g. I click the word Subject), the cursor ends up in the Subject field. Also if I click to the right of the Subject field. If I had an Entering event for this field, naturally it would execute at that time.
Also, note that it’s possible to enter a field using the Tab key, without clicking anywhere.
I’m trying to understand why you want to distinguish between someone entering the field by clicking on the field, versus near the field (or perhaps versus tabbing into it). I suspect you don’t really want to detect entry to the field – you’re trying to immediately detect when the field is changed. Is that right? But you can enter the field without changing the value, and you can change the value without entering the field (i.e. you’re already in it, then you change it – the change doesn’t happen during hte Entering event).
Instead, use the “refresh form when field is changed” option of the field properties. Have your Postrecalc event remember the previous value and compare to the new value to detect a change.