Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modal form blues
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Modal form blues
Miscellaneous
Thread ID:
00294360
Message ID:
00294360
Views:
72
The code below works. If the sql returns more than 1 record an ad hoc form (frmPopup) is opened containing a grid and shown modally. The user then selects a line and the forms closes gracefully.

The form does not close when lPopupActiveParcels() is called from the beforerowcolumnchange event of a grid.

Note that lPopup is a method of oDE.

Can anybody shed some light on this?

Thanks in advance.

Marc


*-------------------
procedure lPopupActiveParcels(cRough,oDE)
LOCAL cCRS, n
*-- mg 22/11/99
cRough= allt(cRough)
this.cParcel= cRough
if this.lFormatValid()
cRough= this.obzParcelFormat.cKey
endif
cCRS= oVFP.cCRS()
select rgh_Parcel,rgh_date;
from rough;
where rgh_Parcel like cRough+"%";
and rgh_Completed= .f.;
into cursor (cCRS)
n= _tally
do case
case n= 0
oError.Add_("No Parcels found.")
return .f.
case n= 1
select (cCRS)
this.cParcel= rgh_Parcel
return
otherwise
*-- set step on
l= oDE.lPopup(cCRS)
if l
select (cCRS)
this.cParcel= rgh_Parcel
return
endif
oError.Clear_()
return .f.
endcase
*--
* --------------------
procedure lPopup(cCrs,noColumns)
*-- mg 03/06/99
if parameters()= 1
noColumns= fcount(cCrs)
endif
o= createobject("frmPopup")
o.grd.recordsource= cCRS
o.grd.columncount= noColumns
n= reccount(cCRS)
o.nNumberofRecords= n
o.show(1)
this.lUserAborted= (lastkey()=27)
if !oVFP.lActivecontrolIsText()
*-- You want this for grid ... but not for textboxes
keyboard chr(13)
endif

return !this.lUserAborted
<\PRE>

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Next
Reply
Map
View

Click here to load this message in the networking platform