A couple of recent threads on this, and I have just run into it as well. The only problem is that when a form with embedded browse is opened with no existing records, then pressing {ESC} displays all of the records. By that I mean that the base query is lost. If other child records exist for the parent, then {ESC} does not lose the base query.
Why is possible to remove the base query in a form with embedded browse, while base query always stays in a plain form?
Attached is a sample database. The People(n) forms are the parent. A button displays the child records in a form (Phone) with embedded browse. The general approach in the button is this.
People6 form is the last resort. It handles the {ESC} and records are entered correctly, but is not the user interface I want. I also don't want to use OnKey to supress the {ESC} since it has legitimate use to cancel a record.
Let's say that People4 is the form I want to use. Go to the last record (no child phones), press the Edit Phones button. It displays a form with embedded browse, no records, and in data entry mode. If you do data entry, all works perfectly. OTOH, if {ESC} is pressed, then phones for the other parent records are displayed. This is what I want to avoid.
People5 is basically the same thing, but I put the basequeryrun in OnInit of the Phone2 form. same result.
Stan Mathews suggests adding a blank record before the form is displayed. I don't want that. If the user ultimately does not enter a record, I don't want a blank hanging around.
(People1-3 forms are the approaches that give the error if no child record exists, so of no use here.)
Bill.
Why is possible to remove the base query in a form with embedded browse, while base query always stays in a plain form?
Attached is a sample database. The People(n) forms are the parent. A button displays the child records in a form (Phone) with embedded browse. The general approach in the button is this.
Code:
t = table.current() vPersonid = t.person_id query.filter = "person_id = " +quote(vPersonid) query.order = "" DIM layout_name as c layout_name = "Phone" 'varP_Phone = :Form.viewqueried(layout_name,query.filter, query.order ,"hidden-dialog","Center","Top") '------------------------------------- 'revised so form will show even if no current phones exist. varP_Phone = form.load(layout_name,"dialog","","Center","Top") varP_Phone.basequeryrun(query.filter, query.order) varP_Phone.show()
Let's say that People4 is the form I want to use. Go to the last record (no child phones), press the Edit Phones button. It displays a form with embedded browse, no records, and in data entry mode. If you do data entry, all works perfectly. OTOH, if {ESC} is pressed, then phones for the other parent records are displayed. This is what I want to avoid.
People5 is basically the same thing, but I put the basequeryrun in OnInit of the Phone2 form. same result.
Stan Mathews suggests adding a blank record before the form is displayed. I don't want that. If the user ultimately does not enter a record, I don't want a blank hanging around.
(People1-3 forms are the approaches that give the error if no child record exists, so of no use here.)
Bill.
Comment