Hi,
I have the following statement to write the contents of text boxes on a form into 3 tables:
When I run it, it only writes to the 'tblPerson' table in the first insert statement and not the other tables.
Any ideas?
Cheers
Foxy
I have the following statement to write the contents of text boxes on a form into 3 tables:
Code:
Private Sub cmdSubmit_Click()
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO tblPerson (forename, surname, organisation_org_ID, address_1, address_2, address_3, postcode, tel_tel, tel_mob, tel_switch, email, job_title, emp_no, rao, sg) VALUES (txtForename, txtSurname, 1, txtAdd1, txtAdd2, txtAdd3, txtPostcode, txtTel, txtMob, txtSwitch, txtEmail, txtJob_Title, txtEmp_No, txtRAO, txtSG)"
DoCmd.RunSQL "INSERT INTO tblUser (person_ID, [ContactPoint UserID], [Pre-requisite training?], [Date Completed], [Access level requested], Shielder) VALUES (11, txtCPUserID, chkTraining, txtTraining_Date, txtAccess_Level, chkShielder)"
DoCmd.RunSQL "INSERT INTO tblShieldingLeads (person_ID, email_secure, password, line_mgr_name, line_mgr_tel, line_mgr_tel_mob) VALUES (11, txtSecure_Email, txtTel_Password, txtLine_Mgr, txtLine_Mgr_Tel, txtLine_Mgr_Mob)"
MsgBox "Record Saved", vbOKOnly
DoCmd.Close acForm, "frmAddNewPerson"
End Sub
When I run it, it only writes to the 'tblPerson' table in the first insert statement and not the other tables.
Any ideas?
Cheers
Foxy