I have a form that adds a person to a company. After filling out the information, the hard-coded query shown below is run
In addition to adding the new contact in the right place, the very first listing in the database (as far as Access is concerned) gets updated, to have the same company. So far we're only testing, but I can't have Access willy-nilly changing the place of employment of someone every time a new company is added to the Database. I can't disallow updates on the table in case information, like phone number or email address changes.
Code:
INSERT INTO people ( Company, [First Name], [Last Name], Profession, [Direct Dial], Mobile, Email, Fax, AltAdd1, AltAdd2, AltAdd3, AltTown, AltCty, AltPcd, AltCtr )
SELECT Forms!AddPer.Cmp, Forms!AddPer.FN, Forms!AddPer.LN, Forms!AddPer.Prf, Forms!AddPer.DD, Forms!AddPer.Mobile, Forms!AddPer.Email, Forms!AddPer.Fax, Forms!AddPer.AltAdd1, Forms!AddPer.ALtAdd2, Forms!AddPer.AltAdd3, Forms!AddPer.AltTown, Forms!AddPer.AltPcd, Forms!AddPer.AltCty, Forms!AddPer.AltCtr;
In addition to adding the new contact in the right place, the very first listing in the database (as far as Access is concerned) gets updated, to have the same company. So far we're only testing, but I can't have Access willy-nilly changing the place of employment of someone every time a new company is added to the Database. I can't disallow updates on the table in case information, like phone number or email address changes.