I have a from that displays an employees info when selected from a list. The employee then updates text boxes as well as combo boxes to describe a type of project they are working on. I'm trying to add what the employee selects to the Project table. Here is my code so far...
Dim mydb As DAO.Database
Set mydb = CurrentDb()
mydb.Execute "INSERT INTO Project(Project_ID, Dept_ID, Status, [Start_Date], [End_Date], Hours, Priority, SSO_Num, Type, Frequency, Comments) VALUES ('" & Department.Column(1).Value & "', '" & Project.Column(1).Value & "', '" & Status.Value & "', '" & ProjectType.Value & "', '" & Priority.Value & "', '" & Hours.Value & "', '" & Frequency.Value & "', '" & Comments.Value & "', #" & Format(StartDate.Value, "mm/dd/yyyy") & "#, #" & Format(EndDate.Value, "mm/dd/yyyy") & "#)"
Dim rsP As DAO.Recordset
Set rsP = mydb.OpenRecordset("Project", dbOpenDynaset)
rsP.AddNew
rsP!Status = "Status of Project"
Status.AddItem rsP!Status
rsP.Update
rsP.Bookmark = rsP.LastModified
rsP.Close
This code only shows one field of the project table which is status. When I click the AddRecord button on my form I get compile error message. I'm new to coding in VB with Access so if someone could please help I would appreciate it. Thanks.