General information
Category:
Coding, syntax & commands
>>>In my form's INIT method I have the following code:
>>>
>>>PARAMETERS dStartDt, dEndDt, cTitle
>>>ThisForm.dStartDate = dStartDt
>>>ThisForm.dEndDate = dEndDt
>>>
>>>You can't use PARAMETER ThisForm.dStartDate....
>>>
>>>So, how can I keep the parameters "alive" once the INIT method completes?
>>>
>>>Sorry if I'm being thick headed :-)
>>
>>use properties in your subform. in your init, say
>>
>>thisform.subStartDate = dstartdt
>>thisform.subEndDate = denddt
>>
>>they will then be available throughout this form.
>>if you save the form as a class and use createobject(), you won't need to pass by reference. you can get the values after you exit the form by looking at these properties before releasing the form object...
>
>You can also put the properties on your original form and pass just the form name. I do this with a FIND modal form class. The table, field and index tag names are on the original form as properties. If the form name isn't passed, or the form isn't available (shouldn't happen, but I'm the belt-&-suspenders type) then there's just a message box. I store an ID value to original form, but you could store multiple items.
>
>Barbara P.
Barbara,
If you want to send a parm to a form and return a value once the form is closed you have to do the following also:
1. Make the form modal.
2. Create new properties on the form as suggested in the above.
3. Call the form using something like this:
local lcMyReturnVariable
do form myTestForm to lcMyReturnVariable
4. Use the parms as indicated
5. In the unload event of the form, you can return a variable.
something like
return thisform.subEndDate
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only