AndrewMozley
Programmer
I have a form which searches for customers; this is invoked from many parts of an application.
The parameters supplied to this form may include a string to search for customers with a range of names or postcodes or indeed customers satisfying other criteria (outstanding balance, say).
In the Init() method of the form I establish which are the relevant customers, create a cursor of these and display a grid where the user double-clicks on the one he wants.
The form works fine; it displays a grid with the relevant customers, and in due course the unload() method of the form returns a suitable id to the calling form.
If however there is only one customer meeting the criteria I do not wish to invoke the grid. So (and this is where I am going wrong), in my Init() method I say, effectively,
IF <there is only one customer)
Thisform.unload()
<some other instruction>
RETURN
ENDIF
This does not however achieve the result. The (empty) grid is still displayed. I have included other instructions as <some other instruction> including RETURN .F., and NODEFAULT.
None of these achieve the desired result. How can I exit from a form in the Init() method, returning a value to the calling?
Thanks. Andrew
The parameters supplied to this form may include a string to search for customers with a range of names or postcodes or indeed customers satisfying other criteria (outstanding balance, say).
In the Init() method of the form I establish which are the relevant customers, create a cursor of these and display a grid where the user double-clicks on the one he wants.
The form works fine; it displays a grid with the relevant customers, and in due course the unload() method of the form returns a suitable id to the calling form.
If however there is only one customer meeting the criteria I do not wish to invoke the grid. So (and this is where I am going wrong), in my Init() method I say, effectively,
IF <there is only one customer)
Thisform.unload()
<some other instruction>
RETURN
ENDIF
This does not however achieve the result. The (empty) grid is still displayed. I have included other instructions as <some other instruction> including RETURN .F., and NODEFAULT.
None of these achieve the desired result. How can I exit from a form in the Init() method, returning a value to the calling?
Thanks. Andrew