Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function GetTaskListFromAccess(taskPriority as Integer) as String
- Dim db As DAO.Database
- Dim rs As DAO.Recordset
- Dim listOfTasks as String
- Set db = DBEngine.OpenDatabase(“C:my_database.accdb”)
- Set rs = db.OpenRecordset("SELECT * FROM TaskTable WHERE TaskPriority=" & _
- taskPriority, dbOpenSnapshot)
- If not rs is nothing then
- If rs.RecordCount > 0 then
- With rs
- While Not .EOF
- if listOfTask = "" then
- listOfTasks = !TaskName
- Else
- listOfTasks = listOfTasks & vbCrLf & !TaskName
- End If
- .MoveNext
- Loop
- .Close
- End With
- End If
- Set rs = nothing
- End If
- Set db = nothing
- GetTaskListFromAccess = listOfTasks
- End Function
Add Comment
Please, Sign In to add comment