Ok ..I have created Data Access Page based on history table(tblhistory). On Data Access Page I have used Option button (Yes and No)used for student's attendance assessment. When a Supservisor is looking at student information page(Say StudentID 1) and click on No option. Popup window should appear and Supervisor should enter his comments and it should be saved to the same table(tblhistory.Notes) but associated with StudentID1.
If I am using below code without WHERE condition, It is working but is populating all students Notes field with same comment.
Dim varComment, sSQL As String
varComment = InputBox("Please Enter your Comments")
sSQL = "Update tblhistory Set tblhistory.Notes = '" & varComment & "' WHERE StudentID =" & Me.StudentID
MSODSC.Connection.Execute sSQL
StudentID is entered to tblstudent and i have used VBscript with INSERT INTO statement that populates the StudentID field of tblhistory as well.StudentID is selected from dropdown box and his/her information displays rest of the page. Do i have to use kind a recordsetdefs for the above code. Because when I used below code with specific StudentID ,it works fine
Dim varComment, sSQL As String
Dim intStudentID As Integer
intStudentID = 5
varComment = InputBox("Please Enter your Comments")
sSQL = "Update tblhistory Set tblhistory.Notes = '" & varComment & "' WHERE StudentID =" & intStudentID
MSODSC.Connection.Execute sSQL
Please help.......
Sam
If I am using below code without WHERE condition, It is working but is populating all students Notes field with same comment.
Dim varComment, sSQL As String
varComment = InputBox("Please Enter your Comments")
sSQL = "Update tblhistory Set tblhistory.Notes = '" & varComment & "' WHERE StudentID =" & Me.StudentID
MSODSC.Connection.Execute sSQL
StudentID is entered to tblstudent and i have used VBscript with INSERT INTO statement that populates the StudentID field of tblhistory as well.StudentID is selected from dropdown box and his/her information displays rest of the page. Do i have to use kind a recordsetdefs for the above code. Because when I used below code with specific StudentID ,it works fine
Dim varComment, sSQL As String
Dim intStudentID As Integer
intStudentID = 5
varComment = InputBox("Please Enter your Comments")
sSQL = "Update tblhistory Set tblhistory.Notes = '" & varComment & "' WHERE StudentID =" & intStudentID
MSODSC.Connection.Execute sSQL
Please help.......
Sam