Thanks for the reply. I'm not sure what you mean by "Get your views to be updatable for new records". I have been trying to resolve this problem for days. I found a way to make it work but I don't think it's the best way. I also don't think it will perform well on large tables since I have to create a separate view for each table I want to add rows to, use that view to add a row, requery() the main table after the tableupdate(), change the foriegn key in the main view, and finally requery() the main view again to get the add row data.
Does anyone know a better way?
Does anyone know why I get the "No updatable tables found..." error message (see code below)?
Here's the sample program I created. You can cut an paste it into a .prg and run it.
* Sample.Prg
* A sample application to discuss adding records to tables
* using views. Developed in VFP 6.0
* Create a database with two tables
* Add data to the tables
* Create two views
* Open the database and use the view
* Change the company for one of the contacts to a new company
* Update the base tables
* Cleanup from last run
Close DATABASES ALL
Erase SAMPLE.bak
Erase SAMPLE.DBC
Erase SAMPLE.dct
Erase SAMPLE.dcx
Erase Company.DBF
Erase Company.CDX
Erase Contact.DBF
Erase Contact.CDX
* Create company
Create TABLE Company ;
(CompId i, ;
Company c(30))
Insert INTO Company ;
(CompId, Company) ;
VALUES (1, "Company1"

Insert INTO Company ;
(CompId, Company) ;
VALUES (2, "Company2"

Insert INTO Company ;
(CompId, Company) ;
VALUES (3, "Company3"

Index ON CompId TAG CompId CANDIDATE
* Create contact
Create TABLE Contact ;
(ContId i, ;
CompId i, ;
Contname c(30))
Insert INTO Contact ;
(ContId, CompId, Contname) ;
VALUES (1, 1, "Joe Contact1"

Insert INTO Contact ;
(ContId, CompId, Contname) ;
VALUES (2, 1, "Afred Contact2"

Insert INTO Contact ;
(ContId, CompId, Contname) ;
VALUES (3, 2, "Tom Contact3"

Insert INTO Contact ;
(ContId, CompId, Contname) ;
VALUES (4, 2, "Michael Contact4"

Insert INTO Contact ;
(ContId, CompId, Contname) ;
VALUES (5, 3, "Sherman Contact5"

Insert INTO Contact ;
(ContId, CompId, Contname) ;
VALUES (6, 3, "John Contact6"

Index ON ContId TAG ContId CANDIDATE
* Create sample database
Close DATABASE ALL
Create DATABASE SAMPLE
Add TABLE Company
Add TABLE Contact
* Create sample view
Create VIEW lvSample AS ;
SELECT * ;
FROM SAMPLE!Contact ;
INNER JOIN SAMPLE!Company ;
ON Contact.CompId = Company.CompId ;
ORDER BY Contact.Contname
DBSetProp("lvSample","View","Tables", ;
"Contact,Company"

DBSetProp("lvSample.ContId","Field", ;
"KeyField",.T.)
DBSetProp("lvSample.ContId","Field", ;
"Updatable",.T.)
DBSetProp("lvSample.CompId_B","Field", ;
"KeyField",.T.)
DBSetProp("lvSample.CompId_B","Field", ;
"Updatable",.T.)
DBSetProp("lvSample","View", ;
"SendUpdates",.T.)
* Create company view
Create VIEW lvCompany AS ;
SELECT * ;
FROM SAMPLE!Company ;
ORDER BY Company.Company
DBSetProp("lvCompany","View","Tables", ;
"Company"

DBSetProp("lvCompany.CompId","Field", ;
"KeyField",.T.)
DBSetProp("lvCompany.CompId","Field", ;
"Updatable",.T.)
DBSetProp("lvCompany","View", ;
"SendUpdates",.T.)
* Suspend here and set the database update properties
* in the view designer. It don't work when I set them
* in code. I get error "No updatable tables were found..."
* Anybody know why?
Modify view lvCompany
Modify view lvSample
* Add a new company by changing the company ID
* and company name of contact3
Close DATABASE ALL
Open DATABASE SAMPLE
Use lvSample
Use lvCompany in 0
Select lvCompany
Insert into lvCompany ;
(CompId,Company) values (4,"Company4"

Tableupdate()
Select lvSample
Requery() && the source table has changed
Locate FOR ContId = 3
Replace ;
compid_A with 4
Tableupdate()
Requery() && get the new company info
Browse nowait
Return
* End SampApp