I have a basic form that is capturing the following fields.
COD, Manager, Staff, Contract_Number, Fiscal-Year, Quarter, Date_Opened, Dated_Closed, Category, Problem, Description
I noticed that 3 fields; StaffID, ProblemID and CategoryID are not writing to the Problem_Record tbl so I added them to the bottom of the form and changed Visible to No.
I have added them into the code below but it is still not writing them. I have attached a copy of my form.
StaffID, ProblemID and CategoryID are each part of separate tables and are linked to the Problem_Record tbl.
How do I get it to lookup the corresponding ProblemID from the Problem tlb and add that to the Problem_Record tbl?
Private Sub cmdAdd_Click()
'add data to table
CurrentDb.Execute "INSERT INTO problem_record (cod, manager, staff, staffID, problemID, categoryID, contract_number, fiscal_year, quarter, date_opened, problem, category, description)" & _
" VALUES(" & Me.COD & "','" & Me.Manager & "','" & Me.Staff & "','" & Me.StaffID & "','" & Me.ProblemID & "','" & Me.CategoryID & "',' " & Me.Contract_Number & "','" & Me.Fiscal_Year & "','" & Me.Quarter & "','" & Me.Problem & "','" & Me.Category & "','" & Me.Date_Opened & "','" & Me.Description & "'"")"