>>>>>BTW, one funny thing here - on my form I only have 3 grids, nothing more. Now, in order to avoid problem with Preview and grids documented in my FAQ should I put an invisible button on the form to set focus to? But if it's invisible, would I be able to set focus to it?
>>>>
>>>>Most likely not, but you can make it visible right before preview, set focus on it and make invisible after preview.
>>>
>>>This doesn't work, for some reason. The idea of moving the button outside the visible portion of the screen doesn't work either. Perhaps I really need to have the button visible and on the form.
>>
>>Did you try DOEVENTS before Button.Setfocus?
>
>Ok, that's a tough one and I think I saw the same problem discussed before.
>
>The problem again:
>
>I have a form with 3 grids (bound to CA each).
>
>I have a toolbar button to print. After I created my cursor I put the following lines:
>
>SELECT curReport
>browse
>thisform.cmdPrint.SetFocus()
>REPORT FORM Software_Hardware_Other PREVIEW
>
>USE IN curOther
>USE IN curSoftware
>USE IN curHardware
>USE IN curReport
>
>I put cmdPrint on the form and made it visible. I left normal top and left so I can see the button.
>
>Browse displayes the correct result yet I have an error variable iSoftware_Active is not found even in Preview now.
>
>The form is modeless.
>
>Thanks in advance.
>
>Running report outside this form works fine. I guess I need to create a new FAQ for printing reports from the forms with multiple grids now <g>
I would set focus on the button before collecting data in the cursor. It must work.
Edward Pikman
Independent Consultant