Speeding up data entry in a form

I have a simple data entry form with two text editor objects: ItemNumber and Quantity. After entering the first item number I tab and enter the quantity. At that point I’d like to be able to hit return and have an additional record added and the data entry point return to the ItemNumber TEO. The goal is not to have to leave the keyboard to add a new record or to get back into the ItemNumber TEO.

Have hunted and experimented with no success, which usually means I’ve missed some elementary info somewhere.

Somewhat related: When using either gettext or the new gettextdialog, is there a way to have the cursor appear in the text entry box without having to click there? Again in the interest of speed.


I am pretty sure the answer is still no, there is no way to have the Gettext input box active when first called. It used to be, until Apple updated the software maybe two years ago and then it wasn’t. I just added a post about a custom statement that I uploaded, alertsheetinputcustomstatement. It does give a input box that is active when the alertsheet opens. That could be modified to have two input boxes, isn’t that true, Gary? That would, I think, do what you want. This is not easy stuff so having the benefit of Gary’s procedure, which I incorporated into the custom statement, makes is accessible.

After an excessive amount of head scratching, I finally came up with a simple fix that allows two or more of Gary’s procedures to be used in sequence. The problem I had was that my own code included a loop which collided with the loop in Gary’s gettext procedure. The fix was to add a goto. Here’s the simplest of my modified procedures:

// User inputs an item number, saves it in a variable, then does the same for the quantity needed:

startOver: // the goto label

local theSearchTerm,thePrompt
thePrompt=“Enter the full item number.”

call .gettextsheet,thePrompt,theSearchTerm //the first call to Gary’s procedure

Select ItemNum MATCH theSearchTerm

    if theSearchTerm=""
    AlertNoYes "You did not enter a search term. Would you like to stop searching?"
        Repeatloopif info("DialogTrigger") contains "No"  

if ItemNum NOTMATCH theSearchTerm
    AlertYesNo "I didn't find any items matching your term; try again?"
        Repeatloopif info("DialogTrigger") contains "Yes"

// Now get the quantity requested:
local theQuantity,thePrompt
thePrompt=“How many?”
call .gettextsheet,thePrompt,theQuantity //Second call to Gary’s gettext procedure

// Data in the two variables is now stored in the database for later use:
Field QO_ItemNum
Fill theSearchTerm
Field QO_QTY
Fill theQuantity

goto startOver: // Take user back to the top so that the data entry repeats without interruption and without
// needing to click

while forever


Without the goto, the loop in Gary’s procedure got stuck on the second (quantity) prompt and never took the user back to the top.

Thanks thanks thanks especially to Gary!


Yes, it could be expanded but at this point you would be far better off to roll your own form and open it for editing either as a floating window or as a sheet using the rundialog method. Using the Dialog Workshop available from the Program menu when a procedure is being edited you can throw together a quick starting dialog as long as you have already made the form to be used.