I just tried replacing
dbs.Execute ("delete AttId from sysDeptDef where DeptId='" & CurrentDeptId & "'")
with
rst_local.delete
It worked :)
Thanks for your replies
Yes i can just delete the entire row.I was just playing with the code to try my luck. when i delete the netire row with that deptid..i think both the rows with same deptid are deleted.when the process searches for next record it cannot find the record since it is already deleted and process...
HI,
I am using the following function to delete a record from sysDeptDef table which is not present in ups_new table. I have two rows for the same deptid but diff attid. when i use the delete command the two rows get deleted but when the loop executes it cannot find the deptid so it fails.can...
I think the problem is with currentlevel.i have tried inserting one at a time..it breaks when i insert currentlevel..
Level field in the table is a number....currentlevel is an integer
do you think anything is wrong with mismatch of datatypes?
I have removed that field and i am inserting into a new table sysDeptNew. Sorry i didnot paste the correct tabelname. I didnot wanted to mess with sysDeptDef so i created anotehr table same fields datatypes but with no oc_id.
INSERT INTO sysDeptDef(DeptId,DeptId_Up1,DeptId_Up2,AttId,LobId,Level,Oc_id,LevelCheck) VALUES ('D000139010','L4_DEPTID','L3_DEPTID',2,'L5_DEPTID',5,False)
I have chnaged the code to
MsgBox ("INSERT INTO sysDeptNew (DeptId,DeptId_Up1,DeptId_Up2,AttId,LobId,Level,LevelCheck) VALUES ('" & _...
Dim CurrentLevel As Integer
Dim CurrentDeptId As Variant
Dim LevelUp1 As String
Dim LevelUp2 As String
Dim LobId As String
Dim AttId As Integer
Dim Oc_Id As Integer
Dim LevelCheck As Boolean
Set rst_check = dbs.OpenRecordset("Select dept_level,deptid from...
Dim CurrentLevel As Integer
Dim CurrentDeptId As Variant
Dim LevelUp1 As Variant
Dim LevelUp2 As Variant
Dim LobId As Variant
Dim AttId As Integer
Dim Oc_Id As Integer
Dim LevelCheck As Boolean
Set rst_check = dbs.OpenRecordset("Select dept_level,deptid from...
Hello,
I have given the code for the function.
Sub DeptCheck_New()
Dim dbs As DAO.Database
Dim rst_pplops As DAO.Recordset
Dim rst_local As DAO.Recordset
Dim CurrentLevel As Integer
Dim CurrentDeptId As String
Dim LevelUp1 As String
Dim LevelUp2 As String
Dim...
Do Until rst_local.EOF
If rst_pplops(LevelUp1) = rst_local("DeptId_Up1") And _
rst_pplops(LevelUp2) = rst_local("DeptId_Up2") And _
rst_pplops("Dept_Level") = CurrentLevel And rst_pplops("EFF_STATUS") = "A" And rst_pplops("DeptId") = CurrentDeptId Then
'If...
If rst_pplops(LevelUp1) = rst_local("DeptId_Up1") And _
rst_pplops(LevelUp2) = rst_local("DeptId_Up2") And _
rst_pplops("Dept_Level") = CurrentLevel And rst_pplops("EFF_STATUS") = "A" And rst_pplops("DeptId") = CurrentDeptId Then
rst_local.Edit...
HI,
It has been long time i used Acess. I am trying to check a condition and edit the recordset.
there are two recordset rst_local and rst_pplops.I compare the records from each recordset and edit one of them.
The condition is
If rst_pplpos("Deptid")=rst_local("DeptId") And...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.