Code below.. it manages to copy the specific records from one table to another when i'm copying everything, (the first two)
however, i also need to copy a specific record from another table.. It errors out on the red line. where FindFirst doesn't seem to work
Code: Select all
Private Sub Command9_Click()
' button clicked to start a new tour
' need to loop through the line selected, and add the questions to the main Data table, ready to answer ....
Dim rec1 As DAO.Recordset
Dim rec2 As DAO.Recordset
Dim rec3 As DAO.Recordset
Dim MyRecordsFromTable As String
Dim sql As String
If IsNull(Me.Combo13) Then
MsgBox ("Must select an entry")
GoTo JumpToEnd
End If
MyRecordsFromTable = Me.Combo13.Column(1)
If MsgBox("Are you sure you want to create " & MyRecordsFromTable, vbYesNo + vbQuestion) = vbNo Then
GoTo JumpToEnd
End If
Set rec1 = CurrentDb.OpenRecordset(MyRecordsFromTable)
Set rec2 = CurrentDb.OpenRecordset("Data")
Set rec3 = CurrentDb.OpenRecordset("Questions")
rec1.MoveFirst
Do Until rec1.EOF
rec2.AddNew
rec2!QuestionAsked = rec1!Qnumber
rec2!Respon_P = rec1!Responsible_Person
[b]rec3.FindFirst "ID = " & rec1!Qnumber[/b]
' row above here, doesn't work
Temp = rec3!MyPRP
Stop
rec2.Update
rec1.MoveNext
Loop
Set rec2 = Nothing
Set rec1 = Nothing
Set rec3 = Nothing
JumpToEnd:
End Sub