Keeping the cursor in the request control

I need to check the entries in the request form. Okay, that’s no problem, because the triggers give me opportunity enough to do so. But how can i keep the cursor in the control, if i recognize an error there ? The user should be given a message and the cursor may not leave the control until a correct entry is done (or the cancel button is pressed). Stefan Weinreich Billing Analyst

Try CurrForm.controlname.ACTIVATE This should set the control controlname as the active control on the form. Chris Krantz NCSD,NCSQL,MCSD,MCSE Microforum Inc. Toronto, Ontario, Canada

RequestOptionsForm.xx.VISIBLE := false; You must rename control xx

Thanks, but both proposals don’t work. Despite of the ACTIVATE the cursor runs to the next control, and VISIBLE := FALSE simply blinds out the field. Stefan Weinreich Billing Analyst

Hi Stefan, try the following: put the code for controlling the entry in the OnDeactivate-Trigger of the first control. if the entry is wrong you call a message and set a variable of type boolean to true. In the activate-Trigger of the next control you ask if the variable is true. if so, you call RequestOptionsForm..activate where stands for the name of the control. You must give a name to the controls! You can`t use the standard names! Hope this will help you. I have tried it and it works. But there are problems if you have more than two controls and the user clicks in an other control. It is much more work to solve this problem! Greetings, Frank

Hey, Frank gave me the final kick ! I could solve the problem by creating a boolean variable with X dimensions, where X is the number of controls in the request form. In every OnActivate-Trigger of the requestform the corresponding cell in the boolean variable is set to FALSE and a function is called, which handles the entries in the boolean variable and activates the control with the error. The OnValidate-Trigger sets the cell of the variable to TRUE, if there is found an error. Works fine, but is some work to enter in every control of the requestform. Stefan Weinreich Billing Analyst

On OnValidate trigger Put your codes checking here but before giving error message, set CurrForm.ControlName.ACTIVATE

Hi Loan, Have you tried it? It does not work! Greetings, Frank