I have a data entry form with some text editor objects, attached to either text fields or numeric fields. There is a popup menu that runs a proc to look up a value and place it into one of the numeric fields. That integer numeric field is set in the datasheet to use an output pattern #, with commas, as in 45,000. That field also has some datasheet code to sum up a few numeric fields and place the sum in another numeric field.
Using the popup to run the proc looks up a value, and it appears in the number TE on the form, as intended. If I type directly in that entry field, the display switches as expected: The comma disappears while typing, and reappears when finished. All OK.
But, if the cursor is in a text field, and I then use the popup menu (as a user might) the correct numeric value does appear in the number entry field, and the sum value appears in its field, so the datasheet code runs OK. BUT, when I then click in the background of the form, I get a message “xxxx is not an integer value…”
The xxx value comes from whichever text field the cursor was in.
I solved this problem with a closeactiveobject at the start of my lookup procedure, to get the focus away from any text field the cursor might be in. No more errors… but I got a new problem.
After the procedure is finished, a common thing to do is to use the up-down arrow keys to move to another record, but doing so results in a beep, and no movement through the records. I have to click once in the form, anywhere, to get moving again.
I tried a goform to the same form, at the end of the lookup procedure, but no, the keys just beep until I click once in the form.
How do I “get the focus” back to the form so the arrow keys work?
Or, what should I do at the start of the proc if closeactiveobject is not what I need?
(I mentioned the comma display format, because I got the same error, several times, with the message saying “45,000” is not an integer value, but I can’t seem to duplicate that right now. I’ve also gotten it in the past when entering data into the datasheet.)