469,142 Members | 1,112 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,142 developers. It's quick & easy.

recordset column and row identification

2
Hello everyone,

New to the site and forums and was hoping someone could assist with a question.

I am working on a Form where, based on the Form selection a query will pulled and all values within the Lucent column will be skilled to the designated skillset.

The problem I have, is I am unable to appropriately the Agents variable so I can loop through each Lucent.

I believe that if i can identify Agents = rst(0 , x), where 0 equals the first field(Lucent) and x = the row number, then I would be able to wrap my skilling code with
Do until x <= LastRow
*skill code*
x= x+1
Loop

I believe I am on the right track and any help would be greatly appreciated

Expand|Select|Wrap|Line Numbers
  1. Private Sub Skill_Click()
  2.  
  3. Dim rst As DAO.Recordset
  4. Dim Agents As String
  5. Dim ACD As Integer
  6. Dim C As Integer
  7. Dim i As Integer
  8. Dim S As Integer
  9. Dim Skill As Integer
  10. Dim Level As Integer
  11. Dim SetArr() As Variant
  12. Dim skillCnt As Integer
  13. Dim fldSkill As String
  14. Dim fldLevel As String
  15.  
  16.  
  17.  
  18. Dim LastRow As Long
  19. Dim LastCol As Long
  20.  
  21.  
  22. Set cvsApp = CreateObject("ACSUP.cvsApplication")
  23.  
  24.  
  25.     Set cvsSrv = cvsApp.Servers(1)
  26.     Set AgMngObj = cvsSrv.AgentMgmt
  27.     On Error Resume Next
  28.     AgMngObj.AcdStartUp -1, "", cvsSrv.ServerKey, -1
  29.  
  30.  
  31. If [Group] = "Arise Element w/FU STS" Then
  32.         Set rst = CurrentDb.OpenRecordset("qryAriseElement w/FU STS")
  33.  
  34.  
  35. '        LastRow = DCount("*", "qryAriseElement w/FU STS") + 1         'Row count
  36. '        Debug.Print LastRow
  37. '        LastCol = rst.Fields.Count + 1                      'Column count
  38. '        Debug.Print LastCol
  39.  
  40. Else
  41.     'Do nothing
  42. End If
  43.  
  44. ACD = 3
  45.  
  46. skillCnt = (LastCol - 2) / 2
  47. Agents = rst("Lucent")
  48.  
  49. '    Do until - loop until all Agents have been skilled
  50.         S = 1
  51.             ReDim SetArr(skillCnt, 4)
  52.         Do While S <= skillCnt
  53.             fldSkill = "Skill" & S
  54.             fldLevel = "Level" & S
  55.                 On Error Resume Next
  56.                 Skill = rst(fldSkill).Value
  57.                 Level = rst(fldLevel).Value
  58.                 SetArr(S, 1) = Skill
  59.                 SetArr(S, 2) = Level
  60.                 SetArr(S, 3) = 0
  61.                 SetArr(S, 4) = 0
  62.                 S = S + 1
  63.         Loop
  64.             AgMngObj.AcdStartUp -1, "", cvsSrv.ServerKey, -1
  65.             AgMngObj.OleAgentSetSkill_R16_1 ACD, Agents, 1, 0, 0, 0, skillCnt, SetArr, ""
  66. '   Loop
  67.  
  68. End Sub
3 Weeks Ago #1
0 3031

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Bernie Yaeger | last post: by
5 posts views Thread by zMisc | last post: by
3 posts views Thread by dale.zjc | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.