Hi all,
I have a script that creates a new record from dialog boxes, as follows:
This is fine if the "Activities" table is not in use by another form, but the table.open() line causes an error if the table is open.
How do I get around this, please?
I have a script that creates a new record from dialog boxes, as follows:
Code:
dim tbl as P tbl = table.open("activities") tbl.enter_begin() tbl.Custid = var->currClient tbl.Funder_id =var->currFunder dim filtContact as c filtContact = "Contactid = " + quote(var->currContact) tbl.Contact = lookup("Funder_Contacts",filtContact,"Contact") tbl.Position = lookup("Funder_Contacts",filtContact,"Position") tbl.Telephone = lookup("Funder_Contacts",filtContact,"Telephone") tbl.Address1 = lookup("Funder_Contacts",filtContact,"Address1") tbl.Address2 = lookup("Funder_Contacts",filtContact,"Address2") tbl.Address3 = lookup("Funder_Contacts",filtContact,"Address3") tbl.Address4 = lookup("Funder_Contacts",filtContact,"Address4") tbl.Town_city = lookup("Funder_Contacts",filtContact,"Town_City") tbl.County = lookup("Funder_Contacts",filtContact,"County") tbl.Postcode = lookup("Funder_Contacts",filtContact,"Postcode") dim filtFunder as c filtFunder = "Funder_Id = " + quote(var->currFunder) tbl.Organisation = lookup("funders_new",filtFunder,"Funder_Name") tbl.Charity_no = lookup("funders_new",filtFunder,"Charity_No") tbl.Created_by = user_name() tbl.Created_date = date() tbl.enter_end(.t.) tbl.close()
How do I get around this, please?
Comment