Dear Experts,
I have two form classes: frmBrowser and frmEntry.
Class frmBrowser is basically used as a UI to show user existing records of a table. Its uses:
1. It can be passed a "browse" or "search" mode. The only difference between the two modes is that "search" mode sets focus to a finder textbox and makes the form Modal.
2. Has buttons to allow user to Add, Edit, Delete. This will call instances of class frmEntry.
It has the ff Init code:
LPARAMETERS tcCAClass, tcCAClassLib, tcMode, toCallingForm
This.oCursor = NEWOBJECT( tcCAClass, tcCAClassLib )
WITH ThisForm
.LoadData()
llLockScreen = .LockScreen
.LockScreen = .F.
IF PCOUNT() >= 4
.Mode = tcMode
.oCallingForm = toCallingForm
.oCallingForm.oReturnData = NULL
.txtFind.SetFocus()
.WindowType = 1
ENDIF
.LoadUIControls()
.ResizeForm()
.RefreshControls()
.LockScreen = llLockScreen
ENDWITH
Class frmEntry is basically a data entry form which asks for a Mode parameter and PK value (for Edit and Delete modes). It is always in MODAL mode.
The typical scenario I want to happen is this:
1. User elects to browse Customers, my app calls frmBrowser (instantiated from class frmBrowser) and passes the CA of Customer table, its VCX, and a "browse" mode value.
2. frmBrowser comes up. Good.
3. User elects to add, edit or delete. frmBrowser calls frmCustomer to allow user. Good.
4. in frmCustomer, I have a button which calls frmBrowser, but this time is passed the CA of Salesman table, its VCX, then the "search" mode value, and a ThisForm reference. This is supposed to show frmBrowser containing Salesman records, and behaves as a search form.
Number 4 is where the problem arises, frmBrowser, which should show the Salesman table, just flashes!The button which calls frmBrowser from frmCustomer has this code:
DO FORM frmBrowser WITH "mySalesmanCA", "myVCX", "SEARCH", ThisForm
So far, this is what I have noticed:
1. If I create a form, and a button in it to call frmBrowser with the needed parameters it works fine.
2. But if I have frmBrowser called, which calls frmEntry, which calls frmBrowser again (as a search form), the last one just flashes.
Been at it for a whole day with no success. I have also tried to make frmCustomer both as Modal and Non-Modal, with the same flashing result.
Thanks In Advance
Dennis