TEO won’t close when procedure finishes


#1

I have a TEO on a form, assigned to the Field “ReviewHoldDate” (field properties are Date MM/DD/YY) with the procedure below attached. The procedure is triggered at End Editing. If I click in the TEO, enter a date and exit the TEO – the procedure removes the date (because the DBO/field ArchiveNo = X) and displays the message. BUT, the cursor continues to blink in the ReviewHoldDate TEO as if it is still active. If I click in any other TEO on the form – I get a blinking cursor in both. I have tried multiple different ways to resolve this without success, including creating a new database with just these two fields/objects. Also, I have other procedures assigned to different TEO’s… without problems – only this one.

Field ArchiveNo
If ArchiveNo = “X"
Field «ReviewHoldDate»
«ReviewHoldDate»=”"
closeactiveobject
Beep Message “You cannot enter an Archive Hold Date if the record series does not have Archival Status!” Stop
Endif

Note: ClearCell also works.


#2

I’ve seen something like this, too. Too long ago to track it down right now, so this is just a confirmation.
Bill


#3

I would rewrite your code simpler as:

    «ReviewHoldDate»=""
    Beep
    Message "You cannot enter an Archive Hold Date if the record series does not have Archival Status!" 
Endif```

There should be no need to go to fields to change their values so you can eliminate the `Field` statements.  Since the TEO does not run the procedure until the object is closed you should not need the `closeactiveobject` statement. Also, if this is the complete procedure, you should not need the `stop` statement either.

I noticed when trying to duplicate your problem that I got a crash when I added the `closeactiveobject` statement to my procedure. It would crash even if this was the only item in the procedure if I had the Procedure Trigger set to End Editing.

#4

Thanks Gary… I still get the flashing cursor when the procedure ends. The stop after the message statement is there because there is more to the code. I added the field and closeactiveobject trying anything to get that TEO to close, but still won’t close even with your rewrite.


#5

I can’t duplicate the problem myself, but if I were you I would comment out all of the procedure to see if the TEO closed properly. If it did I would then slowly activate portions of my code a little at a time until the problem reemerged.


#6

Commenting out the entire procedure, the TEO does close properly. Adding back a step at a time does this:

If ArchiveNo = "X"
endif
It also closes properly

But…
If ArchiveNo = “X”
«ReviewHoldDate»=""
endif
The TEO does NOT close

Or…
If ArchiveNo = "X"
Beep
Message "You cannot enter an Archive Hold Date if the record series does not have Archival Status!"
endif
Doesn’t close either

The cursor continues to blink even in graphics mode. Earlier I created a new database with only these two fields and objects - got the same results.


#7

I see nothing to indicate why the various codes you show would cause the problem. Try as i may I can’t duplicate the strange behavior so I’m left without any further suggestions. If it is ok with Jim, you could send your simplified example file to him to see if he can troubleshot it.


#8

Thanks for taking a look Gary, I have the simplified example on my desktop - would be happy to share. Just tested the example again - same problem. How can I share a copy?


#9

Sure…you can send it to me directly (gary@yonaites.com) or attach it with a post here if you don’t mind having others looking at it as well.


#10

I just solved the problem… I’m probably the only one that sets form properties background color, then place another colored rectangle as my form with various objects. If I click in the TEO and then click in the form background - the procedure runs but the cursor remains active in the TEO. However, if I terminate with return or tab keys - it works as expected. I think Jim mentioned something about layering problems earlier. I’ll send the file to your email so you can see what I’m talking about. It’s a Pan file so not sure how to share on this forum.


#11

I have taken the liberty of making this file available to others TEOtest.pandb.zip. Yes, I’m pretty sure your problems involve the colored form background you have implemented. Without the colored form background I do not see the problem.


#12

Thank you Gary… My staff and I all like the colored backgrounds (simply because it covers the entire desktop - our forms of course do not) – but that results in a number of problems – in PanX we do not see the focus ring and would really like to, and of course the problem we discovered today. This latest issue drove me nuts trying to find the solution – but hey… it was right in front of me all the time. :smiley:

Here’s a screenshot of the entire form