"Not working" doesn't give a lot of information.
What is not working?
Code doesn't execute?
Any error messages?
The fields referenced are text type fields?
Field names correct?
Control names correct?
I did notice there is a missing space before the "VALUES" keyword.
Code:
Class,[Enrolled Campus])Values('" & Me.Student_Name
Try executing the following
Code:
Private Sub Command19_Click()
Dim sSQL As String
sSQL = "INSERT INTO [student attendance_log]([Student Name] ,[Student Surname],Class,[Enrolled Campus])"
sSQL = sSQL & " Values('" & Me.Student_Name & "','" & Me.Student_Surname & "','" & Me.Class & "','" & Me.Enrolled_Campus & "');"
'-------
' comment out following line when debugging is complete
Debug.Print sSQL '<<-- check the immediate window to see if the SQL string is correct
' -------
CurrentDb.Execute sSQL, dbFailOnError
MsgBox "Record Saved !!!", vbInformation, "Success"
End Sub
What is in the immediate window?
Note: shouldn't have spaces in object names.......