Modifying a Table

I wanted to know if it was possible for me to modify a table that doesn’t have the same primary key as the table that I get the information from. Here is the table that I need to modify: Table A Entry No. (primary key) : : : : Occupied? (the field that I will have to modify) Here is the table that I get the information from: Table B Entry No. (primary key) : : : Table A Entry No. (table relation to Table A) Occupied? (once it is a YES, then I will have to modify this field in Table A) Thanks in advance. sylvia tsang

Yes, it is possible. But I think I don’t understand your question. Maybe you can be more specific? -when do you want to modify -what do you want to modify -maybe put some code with it?

After I have entered data for each record in Table B, if the “Occupied?” field was checked, then I would press the command button (update button), then the “Occupied?” field in Table A will be checked also. Actually, I just wrote some codes for it, which exists on Table B Form on the update button, and here is the code: IF TableA.GET(“Table A Entry No.”) THEN BEGIN TableA.“Occupied?” := TableB.“Occupied?”; TableA.MODIFY; END; The codes look right, but unfortunately, it didn’t modify the “Occupied?” field in Table A … Thanks sylvia tsang

There are two things that you should trie: in the first: change the line TableA.“Occupied?” := TableB.“Occupied?”; to: TableA.“Occupied?” := “Occupied?”; If this doesn’t work … and that wouldn’t surprise me… just try the following (I presume that the field “Occupied?” is a Boolean). Change the line to: IF (TableB.“Occupied?” = TRUE)THEN TableA.“Occupied?”:=TRUE ELSE TableA.“Occupied?”:=FALSE; Don’t forget the ( and ). Ofcours you should leave the “TableB”, since TableB Is the current record. This would make (finally): IF TableA.GET(“Table A Entry No.”) THEN BEGIN IF (“Occupied?” = TRUE)THEN TableA.“Occupied?”:=TRUE ELSE TableA.“Occupied?”:=FALSE; TableA.MODIFY; END;