I'm working with two forms, quotes and reviews. I'd like to be able to open the review form from the quotes form and view the related record (one or no reviews per quote).
So I'd like to open the review form and pass in the review no (which is a field in the quotes table). When the form opens, I'd like to scroll to the related record (ie the record whose primary key = the parameter value.)
Could someone please explain how to do this in ObjectPal, or by some other method. I'm using paradox 9.
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:
method pushButton(var eventInfo Event)
;make sure there is a value in the reviewNum field
if ReviewNum.value = ""
then msgStop("Error","No Review Number!")
;load an environment variable with the data
;open the review form and wait.
AND this code is in the Open method of the Reviews MRO on Reviews.FSL:
method open(var eventInfo Event)
RevPassNum = longint(readEnvironmentString("RevLoad"))
;use this to make it where they cannont scroll to other records
;OR this to do a simple locate that allows them to see other reviews
;if not Reviews.locate("ReviewNum",RevPassNum)
; then errorShow()
;the Reviews MRO is not visible at run time. This brings it up.
;sometime this helps with screen flicker.
Reviews.visible = True
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.