> I want to use a combo box on a form to select the
> record to be viewed or
> edited on the same form.
There isn't anyway to change the underlying record set
from inside an R:Base form. You need to close the
form and reopen it with a new WHERE clause.
If you're willing to close and reopen the form, you
can do what you want pretty simply. Your code will
look something like:
SET VAR vLookupID INT = NULL
WHILE 1 = 1 THEN
EDIT USING MyForm WHERE IDColumn = .vLookupID
IF vLookupID IS NULL THEN
BREAK -- From WHILE loop
ENDIF
ENDWHILE
Now, in your form place your combo box and right next
to it a button labelled "Go" or "Edit Now" or
whatever. The code in this EEP should include
SET VAR vLookupID = .vComboBoxVariable
CLOSEWINDOW
Now, when the user clicks on the Go button, the form
will close, the WHILE loop will loop, and the form
will reappear with the new record. Voila!
When the user closes the form without hitting the Go
button, the variable vLookupID will be NULL and the
WHILE loop will exit.
(Instead of using the button, you could put your code
in the OnClick EEP of the combo box, but the user
might fire it accidentally while just looking through
the list of names).
To do what you want to do WITHOUT closing and
reopening the form, you would have to edit all records
in the table and then write an EEP to move the first
record and do a NEXT until it found the right record
-- guaranteed to be SLOW unless you can strictly limit
the number of records in the table.
--
Larry