I have a module which looks at a query that has 3 records. i am trying to input this data into a single word document setup with bookmarks. Getting error 3061 too few parameters. Expected 1. Any help would be appreciated.
Public Sub ExportCVToWord()
Dim wApp As Word.Application
Dim WDoc As Word.Document
Dim rs As DAO.Recordset
Set wApp = Word.Application
Set WDoc = wApp.Documents.Open("S:\CV\CV -Blank.docx")
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * from Qualifications_Selected_Individual_For_NEWCV")
rs.MoveFirst
'Do Until rs.EOF
WDoc.Bookmarks("Name").Range.Text = Nz(rs!Name, "")
WDoc.Bookmarks("Qualifications").Range.Text = Nz(rs!Qualification, "")
rs.MoveNext
WDoc.Bookmarks("Qualifications2").Range.Text = Nz(rs!Qualification, "")
rs.MoveNext
WDoc.Bookmarks("Qualifications3").Range.Text = Nz(rs!Qualification, "")
WDoc.SaveAs2 "C:\Users\temp\Documents\CVs" & rs!Name & "_CV.Docx"
'Loop
WDoc.Close False
wApp.Quit
Set WDoc = Nothing
Set wApp = Nothing
Set rs = Nothing
'WDoc.Bookmarks("Name").Range.Delete wdCharacter, Len(Nz(rs!Name, ""))
'WDoc.Bookmarks("Qualification").Range.Delete wdCharacter, Len(Nz(rs!Qualification, ""))
End Sub
Public Sub ExportCVToWord()
Dim wApp As Word.Application
Dim WDoc As Word.Document
Dim rs As DAO.Recordset
Set wApp = Word.Application
Set WDoc = wApp.Documents.Open("S:\CV\CV -Blank.docx")
Set db = CurrentDb
Set rs = db.OpenRecordset("Select * from Qualifications_Selected_Individual_For_NEWCV")
rs.MoveFirst
'Do Until rs.EOF
WDoc.Bookmarks("Name").Range.Text = Nz(rs!Name, "")
WDoc.Bookmarks("Qualifications").Range.Text = Nz(rs!Qualification, "")
rs.MoveNext
WDoc.Bookmarks("Qualifications2").Range.Text = Nz(rs!Qualification, "")
rs.MoveNext
WDoc.Bookmarks("Qualifications3").Range.Text = Nz(rs!Qualification, "")
WDoc.SaveAs2 "C:\Users\temp\Documents\CVs" & rs!Name & "_CV.Docx"
'Loop
WDoc.Close False
wApp.Quit
Set WDoc = Nothing
Set wApp = Nothing
Set rs = Nothing
'WDoc.Bookmarks("Name").Range.Delete wdCharacter, Len(Nz(rs!Name, ""))
'WDoc.Bookmarks("Qualification").Range.Delete wdCharacter, Len(Nz(rs!Qualification, ""))
End Sub