1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
Dim list As String
list = ""
list = list & "SELECT RESULTS.OrderID, RESULTS.Comments, "
list = list & "QUESTIONS.DescriptionOfCheck, "
list = list & "QUEST_SUBFORM_AUDIT.rescheck "
list = list & "FROM RESULTS, QUESTIONS, QUEST_SUBFORM_AUDIT "
list = list & "WHERE RESULTS.OrderID = QUESTIONS.OrderID AND "
list = list & "RESULTS.OrderID = QUEST_SUBFORM_AUDIT.OrderID AND "
list = list & "RESULTS.ReportID = 16 AND RESULTS.Quote = CLng(2) "
list = list & "ORDER BY RESULTS.OrderID"
Dim db As Database
Dim rs As Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(list, DB_OPEN_SNAPSHOT)
Dim numb As Integer
rs.MoveLast
numb = rs.RecordCount
Dim i As Integer
For i = 1 To numb
check = rs(2).Value
comments = rs(1).Value
rescase = rs(3).Value
CurrentDb.Execute "INSERT INTO DampTable (Description, Comments, rescheck) Values ('" & Me.check & "', '" & Me.comments & "', '" & Me.rescase & "');"
Next
list = ""
list = "SELECT ID, Description, Comments, rescheck FROM DampTable"
Form_CheckList.RecordSource = list
Form_CheckList.domain = "ID"
Form_CheckList.comments.ControlSource = "Comments"
Form_CheckList.check.ControlSource = "Description"
Form_CheckList.rescase.ControlSource = "rescheck" |
Partager