Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form parameters 1

Status
Not open for further replies.

bedrock

Programmer
Nov 6, 2002
94
US
hi all, although this is my first post to the VFP forums, id like to point out i've been reading your archived posts as i learn VFP, and it's been very helpful. thanks.

anyway, my form has two text boxes which ask for a name and order number. then i pass these two values as parameters for the next form.

my problem is i need the value of these parameters in Load() to populate a grid control on the form. but they are not set until the Init(). whats the trick to get around this?

what we see depends mainly on what we look for.
--John Lubbock
 

Put the LParameters in the init of the form. That is the only place.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
mgagnon:
thanks for your quick response. i do understand the parameters can only go in init().

what i forgot to mention is that the parameters set two properties of the form, which works fine except the grid control seems to be looking for its source data in my form's load() method. since load() executes just before init(), there are no properties set to execute my sql query.

so far i've just unset the record source of the grid. that allowed me to pass everything like i want, now the trick is finding the right place to reset it after the properties are set.

what we see depends mainly on what we look for.
--John Lubbock
 
Actually, what is happening is the form's Load event happens first, then the grid's Init happens, then the form's Init event.
You could try using form variables, either on the parent form or child form.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
i got rid of the properties and execute my sql from init, that is working fine.

im confused why this doesnt work though:
Code:
SELECT myCursor
BROWSE && this brings up window correctly
thisform.mygrid.RecordSource = myCursor &&gives 'variable MYCURSOR not found'

what we see depends mainly on what we look for.
--John Lubbock
 
thanks dsumm, ill give it a try after lunch :)

what we see depends mainly on what we look for.
--John Lubbock
 
hehe...thanks :)

what we see depends mainly on what we look for.
--John Lubbock
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top