V
Vensia
Hello,
I have code like below :
(With back end Access)
Dim rst As DAO.Recordset
Dim strSQL As String
Dim intLoop As Integer
strSQL = "SELECT * FROM tblSalaryMain WHERE EmpID = '" & strEmpID & "'
ORDER BY SalaryMonth"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
For intLoop = 1 To 12
With rst
.FindFirst "SalaryMonth = " & intLoop
If .NoMatch Then
.AddNew
(With back end SQLServer)
Dim rst As DAO.Recordset
Dim strSQL As String
Dim intLoop As Integer
strSQL = "SELECT * FROM tblSalaryMain WHERE EmpID = '" & strEmpID & "'
ORDER BY SalaryMonth"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
For intLoop = 1 To 12
With rst
.FindFirst "SalaryMonth = " & intLoop
If .NoMatch Then
.AddNew
In table tblSalaryMain, I have an Identity field called SalaryID.
In Access, there is no error message.
But in SQLServer, I get error message "No current record".
Please help. Thanks.
Vensia
I have code like below :
(With back end Access)
Dim rst As DAO.Recordset
Dim strSQL As String
Dim intLoop As Integer
strSQL = "SELECT * FROM tblSalaryMain WHERE EmpID = '" & strEmpID & "'
ORDER BY SalaryMonth"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset)
For intLoop = 1 To 12
With rst
.FindFirst "SalaryMonth = " & intLoop
If .NoMatch Then
.AddNew
(With back end SQLServer)
Dim rst As DAO.Recordset
Dim strSQL As String
Dim intLoop As Integer
strSQL = "SELECT * FROM tblSalaryMain WHERE EmpID = '" & strEmpID & "'
ORDER BY SalaryMonth"
Set rst = CurrentDb.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
For intLoop = 1 To 12
With rst
.FindFirst "SalaryMonth = " & intLoop
If .NoMatch Then
.AddNew
In table tblSalaryMain, I have an Identity field called SalaryID.
In Access, there is no error message.
But in SQLServer, I get error message "No current record".
Please help. Thanks.
Vensia