I can't seem to figure out what is going on here. Have a form based on a set. Child table is displayed in embedded browse. Have a button to call a form to add record to child table. When I add the first related child record, it always adds an extra blank record, if I'm refreshing the browse on return from the Add (see below explanation). 2nd and subsequent additions don't.
A sample app is attached and here are the instructions.
1. Open form gpa_worksheet
2. Run this form. In embedded browse in lower right corner (Plan) where it lists months of the year, click on any of the Edit buttons to open up the problem form (gpa_numbers_edit).
3. In gpa_numbers_edit form, click on the Add button to bring up the form, gpa_numbers_add.
4. Enter a record using the drop lists and any values you want then press the Save/Close button to save and close the form.
5. Depending on if I have my code, on return from the add do anything to refresh the browse to get an accurate display, it will add an extra record. The below code doesn't, but on return, the browse isn't displaying correctly until the row is clicked on.
Now this is weird....when I click on the row to get the proper display, an extra record hasn't been entered. (I've got the gpa_numbers.dbf open) As soon as I close the gpa_numbers_edit form, it adds the extra record to the gpa_numbers.dbf table.
IF somebody has the time, I sure would appreciate the extra eyes. It must be my code somewhere that is causing this.
Ernie
A sample app is attached and here are the instructions.
1. Open form gpa_worksheet
2. Run this form. In embedded browse in lower right corner (Plan) where it lists months of the year, click on any of the Edit buttons to open up the problem form (gpa_numbers_edit).
3. In gpa_numbers_edit form, click on the Add button to bring up the form, gpa_numbers_add.
4. Enter a record using the drop lists and any values you want then press the Save/Close button to save and close the form.
5. Depending on if I have my code, on return from the add do anything to refresh the browse to get an accurate display, it will add an extra record. The below code doesn't, but on return, the browse isn't displaying correctly until the row is clicked on.
Code:
'''code on Add button dim t as p dim frm as p t = table.get("gpa_details") frm = form.load("gpa_numbers_add","Dialog") frm.New_Record() frm:gpadtls_id.value = t.gpadtls_id frm:gpaccts_id.value = t.gpaccts_id frm:type_acct.value = t.type_acct frm:gpa_id.value = t.gpa_id frm.Show() frm.Close() 'browse1.Activate() 'browse1.Resynch() 'parentform.Refresh_Layout() parentform.Resynch()
IF somebody has the time, I sure would appreciate the extra eyes. It must be my code somewhere that is causing this.
Ernie
Comment