I wanted to add something of my private response to alberon in case anyone else was interested. Assume Two Forms, Quotes.FSL and Reviews.FSL and two tables with the same names, tied to each of their namesakes.
This code is in the pushbutton method of a button on the Quotes.fsl form:
Code:
method pushButton(var eventInfo Event)
var
revForm form
endvar
;make sure there is a value in the reviewNum field
if ReviewNum.value = ""
then msgStop("Error","No Review Number!")
return
endif
;load an environment variable with the data
writeEnvironmentString("RevLoad",ReviewNum.value)
;open the review form and wait.
revForm.open(":work:Reviews.fsl")
revForm.wait()
endMethod
AND this code is in the Open method of the Reviews MRO on Reviews.FSL:
Code:
method open(var eventInfo Event)
var
RevPassNum longint
endvar
RevPassNum = longint(readEnvironmentString("RevLoad"))
;use this to make it where they cannont scroll to other records
Reviews.setRange(RevPassNum,RevPassNum)
;OR this to do a simple locate that allows them to see other reviews
;if not Reviews.locate("ReviewNum",RevPassNum)
; then errorShow()
;endif
;Reviews.forceRefresh()
;the Reviews MRO is not visible at run time. This brings it up.
;sometime this helps with screen flicker.
Reviews.visible = True
endMethod
As you can see there are two possible methods to display the correct review shown in the second code example. They cannot be used at the same time (hence the comment marks).
The only other thing to note is that when using setRange() the table must be indexed.
Hope this helps,
Mac