Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Rafael Copquin
  Where is Rafael Copquin?
 buenos aires
 Argentina
 Rafael Copquin
 To: Paul Culbertson
  Where is Paul Culbertson?
 Katy
 Texas - United States
 Paul Culbertson
 Tags
Subject: RE: vfp6 return values from form
Thread ID: 201 Message ID: 210 # Views: 2 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Thursday, May 17, 2001 10:10:22 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
> >
> > Thank you Eric
> > But as I said on my second message above, I forgot to mention that I am calling a formset, and not a single form.
> > If I call a single form, it works allright. The problem arises when I call a formset
> > What is the problem ?
> >
>
> Rafael,
>
> You are using a formset? then your properties are properties of the formset right?
>
> I am not familiar with formsets, but to access the formset properties you would use:
> with thisformset.ocriteria
> kprice = .price
> kquantity = .quantity
> kdept = .department
> .release()
> endwith
>
> Personally I don't recommend using formsets as Eric once mentioned before, i agree with him, that formsets are only still in existance for backward compatibility with foxpro 2.x for dos/windows.
>
> Paul Culbertson
>
> Houston, TX
>

Thanks for the advise Paul, but unfortunately you are wrong

a) You can't use thisformset.oCriteria, because the object variable is oCriteria (I tried your suggestion though and it bombed)

b) IT FINALLY WORKED AS FOLLOWS:

do form criteria LINKED NAME oCriteria

As you see, I simply changed the order of the parameters in the above command. I had to put the word LINKED before the word NAME.
Funny, but to me it is a BUG in VFP

c) You know much more than myself about VFP, so your suggestion to avoid the use of formsets is sound. However, I have done intensive use of them in my projects and found the following:

1) If you limit the number of forms in the collection to just a few, they are great
2) you don't have to use private data sessions, which enables variables in the formset to be used widely. If you need to receive values from forms, it is a great way to avoid the problems I am facing with my example
3) They offer a way of grouping together forms that pertain to one main routine into only one form. If anything, it avoids a profussion of forms in the project.
4) as a disadvantage I can mention that if you use too many forms in the formset, getting to the different forms can be a problem, because you either move from the last to the first using the titlebar, or you use the properties window

IN ANY CASE, MY PROBLEM IS SOLVED AND I APPRECIATE YOUR HELP AND ERIC'S

Rafael



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