Hey Guys.
New to the forum here and I have a question on something I am programming in access.
It is within an attendance DBA for our HR department. The issue is on the below 'save' button that should insert several fields, using data on the current form, into a discipline table. The problem is, if I don't have all of the fields entered (which they won't always have) then I get an 3464 data type mismatch error message. I need to find out how to allow null values even though I'm pulling data from the current form that is open. Any help you could offer would be appreciated.
Code:
Private Sub Command38_Click()
Dim strSQL As String
strSQL = "INSERT INTO Discipline ( DateOfIncident, Category, ActionTaken, LossOfBonus, Description, FirstName, LastName, Supervisor, StartOfProbation, EndOfProbation, FollowUpDate1, FollowUpDate2, FollowUpDate3, EmployeeID )" & " VALUES ('" & Me.DateOfIncident & "' , '" & Me.Category & "' , '" & Me.ActionTaken & "' , '" & Me.LossOfBonus & "' , '" & Me.Description & "' , '" & Me.DisciplineFirstName & "' , '" & Me.DisciplineLastName & "' , '" & Me.SupervisorName & "' , '" & Me.StartOfProbation & "' , '" & Me.EndOfProbation & "' , '" & Me.FollowUpOne & "' , '" & Me.FollowUpTwo & "' , '" & Me.FollowUpThree & "' , '" & Me.DisciplineEmployeeID & "');"
CurrentDb.Execute strSQL, dbFailOnError
DoCmd.Close acForm, "NewDiscipline", acSaveYes
End Sub