Hi Lynette,
Your view should have a filter set in the view designer like this:
districtid = ?vp_districtid
where vp_districtid is the variable parameter and districtid is the views primary key field. Don't forget the Question mark as this tells VFP that it is variable parameter that needs to get its value each time the view is queried.
Your modal form seems just fine. But just be sure that the parameter being sent over is of the same type as the key field ie Integer or Character. If its different cast it into the correct type.
The related modal forms need to have an "LPARAMETERS tiid" type statement as the first line in your modal forms Init() and don't forget a following dodefault() Declare the variable parameter as LOCAL ie LOCAL vp_districtid
Then you need to set the value of the variable parameter used in your view to this value. vp_districtid = tiid
and finally you need to requery your view like this:
requery(v_District)
Take a look at my one to many step by step guide and look in particular at the Picklist form and follow the coding through via the Customer Button and on to the Customer form.
Once that is clear see how a similar principle is used in the one to many form - the PO form.
Geof gwhitham (AT) bigfoot .D.OT com
<i><font color="#663300">I am totally going crazy trying to get a form to pass a parameter to another form. This is really BASIC and I feel like this is a SUPER BASIC QUESTION but here goes:
1) Form A is a modeless/one to many to many form (3 bizobjects) Double Clicking on District Name, Contact Last Name or Marketing Date is supposed to bring up a related Modal for to edit the data for THAT bizobj
well the forms come up all right --- but I can't seem to get the modal FORM B to accept and go to the record that Form A is at!
when I call form B, I use: doform('formb', idistrictid)
then formB Init has to have code to go to the passed record id... THIS is where I am STUCK and NOT making any progress... In fact, everything I read and try makes me MORE and MORE confused!
Help would be greatly appreciated!
Lynette</font></i>
©2001 Geof whitham |