Z
zywh
Guest
In the button click event of a MS Access form I've written the following transaction.
Private Sub Command5_Click()
ado_send1.BeginTrans
ado_send1.Execute "Insert into StudentNew" & _
"(VT_Code, SchoolCode,Grade,Name,fatherName,Sex,Age,Category, RegNo,FamilyRegNo,OldStuID) " & _
"SELECT VT_Code, SchoolCode,Grade, " & _
"Name, fatherName, Sex, Age, Category, " & _
"RegNo, FamilyRegNo,ID from MaungDawFDPStudent where id=" & OldStudents.Form.Recordset.Fields("ID").Value
ado_send1.Execute "Update MaungDawFDPStudent set sendstatus=yes where id=" & OldStudents.Form.Recordset.Fields("ID").Value
ado_send1.CommitTrans
End Sub
The above code does not work sometimes. Can anyone help me on how can I solve this?
Thanks
Private Sub Command5_Click()
ado_send1.BeginTrans
ado_send1.Execute "Insert into StudentNew" & _
"(VT_Code, SchoolCode,Grade,Name,fatherName,Sex,Age,Category, RegNo,FamilyRegNo,OldStuID) " & _
"SELECT VT_Code, SchoolCode,Grade, " & _
"Name, fatherName, Sex, Age, Category, " & _
"RegNo, FamilyRegNo,ID from MaungDawFDPStudent where id=" & OldStudents.Form.Recordset.Fields("ID").Value
ado_send1.Execute "Update MaungDawFDPStudent set sendstatus=yes where id=" & OldStudents.Form.Recordset.Fields("ID").Value
ado_send1.CommitTrans
End Sub
The above code does not work sometimes. Can anyone help me on how can I solve this?
Thanks