G
Guest
Hi there!
I have looked through this group for others who have had the same problem
but to no avail. So....
I am trying to run the following code and get Error 3061 Too few Parameters,
Expected 3.
Private Sub Command42_Click()
Dim db As Database, rstQueryData As Recordset
Dim objExcel As Object, intRowCounter As Integer
Set db = CurrentDb
Set objExcel = CreateObject("excel.Application")
With objExcel
.Visible = True
.Workbooks.Add
Set rstQueryData = db.OpenRecordset("qryFindGH", dbOpenSnapshot)
intRowCounter = 0
Do Until rstQueryData.EOF
.Range("A2").offset(intRowCounter, 0) = rstQueryData![Vendor]
.Range("A2").offset(intRowCounter, 0) = rstQueryData![VendorNum]
intRowCounter = intRowCounter + 1
rstQueryData.MoveNext
Loop
End With
End Sub
Excel opens just fine, but with no data in it. When I go back to Access,
the error message is sitting there, laughing at me!
What am I doing wrong here?
J
I have looked through this group for others who have had the same problem
but to no avail. So....
I am trying to run the following code and get Error 3061 Too few Parameters,
Expected 3.
Private Sub Command42_Click()
Dim db As Database, rstQueryData As Recordset
Dim objExcel As Object, intRowCounter As Integer
Set db = CurrentDb
Set objExcel = CreateObject("excel.Application")
With objExcel
.Visible = True
.Workbooks.Add
Set rstQueryData = db.OpenRecordset("qryFindGH", dbOpenSnapshot)
intRowCounter = 0
Do Until rstQueryData.EOF
.Range("A2").offset(intRowCounter, 0) = rstQueryData![Vendor]
.Range("A2").offset(intRowCounter, 0) = rstQueryData![VendorNum]
intRowCounter = intRowCounter + 1
rstQueryData.MoveNext
Loop
End With
End Sub
Excel opens just fine, but with no data in it. When I go back to Access,
the error message is sitting there, laughing at me!
What am I doing wrong here?
J