Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Paul Culbertson
  Where is Paul Culbertson?
 Katy
 Texas - United States
 Paul Culbertson
 To: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 Tags
Subject: RE: vfp6 return values from form
Thread ID: 201 Message ID: 204 # Views: 3 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Thursday, May 17, 2001 8:28:42 AM         
   


> > I am using a private data session form to show inventory items.
> >
> > From a command button, I call another form, modal and private data session, which is used to enter three search criteria.
> >
> > The three criteria are stored to three of the secondary form's properties, namely:
> > thisform.price, thisform.quantity,thisform.department.
> >
> > The secondary form is not closed by using release thisform or thisform.release(). When all three values are entered, the hide method is called.
> >
> > From the command button I issue the following:
> >
> > local kprice,kquantity,kdept
> >
> > do form criteria name oCriteria linked
> >
> > with oCriteria
> > kprice = .price
> > kquantity = .quantity
> > kdept = .department
> > .release()
> > endwith
> >
> > However, I get the message "data taype mismatch" and when I check the values of the variables, the above oCriteria has a value of null.
> >
> > What exactly is happening here ?
> >
> > Thanks in advance.
> > Rafael Copquin
>
> Hi Rafael,
>
> How exactly do you close the second form? If you close it with the X-button in the upper right, then the form will be unloaded. To prevent this from happening issue
>
> this.hide
> NODEFAULT
>
> in the queryunload of the second form
>
> ----------------
> Hth,
>
> Eric den Doop
> www.foxite.com

Hey guys,

One thing i wanted to point out is the ability to utilize the VARTYPE() to aid in these kinds of situations.

Rafael posted this code:
> > do form criteria name oCriteria linked
> >
> > with oCriteria
> > kprice = .price
> > kquantity = .quantity
> > kdept = .department
> > .release()
> > endwith

if you change it to:
do form criteria name oCriteria linked

if vartype(oCriteria)="O"
with oCriteria
kprice = .price
kquantity = .quantity
kdept = .department
.release()
endwith
else
=messagebox("There is a problem with your program the "Form is Not available",16,"Programmer messed up!")
endif

Anyway just some thoughts.

Paul Culbertson
Project Manager/Sr Software Developer
Houston, TX




ENTIRE THREAD

vfp6 return values from form Posted by rafael copquin @ 5/17/2001 7:26:03 AM
RE: vfp6 return values from form Posted by Eric den Doop @ 5/17/2001 7:43:22 AM
RE: vfp6 return values from form Posted by Paul Culbertson @ 5/17/2001 8:28:42 AM
RE: vfp6 return values from form Posted by rafael copquin @ 5/17/2001 8:29:06 AM
RE: vfp6 return values from form Posted by Paul Culbertson @ 5/17/2001 9:25:11 AM
RE: vfp6 return values from form Posted by rafael copquin @ 5/17/2001 10:10:22 AM
RE: vfp6 return values from form Posted by rafael copquin @ 5/17/2001 8:23:44 AM