nightrage
asked on
excel errors
Dim db As Database
Dim rs As Recordset
Dim wb As Object
Dim qstr7 As String
Set db = OpenDatabase("c:\stock.mdb ")
Set wb = GetObject("c:\book1.xls")
qstr7 = " Insert into nice_rpt " _
& "select Description.StockCardNo, Description.Description, Product.Specifications, Received_On.DateReceived, Received_On.QtyReceived, Received_On.UnitPrice, Received_On.BillNumber from Description, Product, Received_On where Description.StockCardNo = Product.StockCardNo and Product.ProductID = Received_On.ProductID order by Product.ProductID "
db.Execute qstr7
Set rs = db.OpenRecordset("nice_rpt ")
With wb
.Sheets("sheet1").Select
.Sheets("sheet1").Cells.Cl earContent s
.Sheets("sheet1").Range("A 1").CopyFr omRecordse t rs
.Parent.Windows("book1.xls ").Visible = True
.Save
.Close
End With
Set wb = Nothing
Set rs = Nothing
i got a
runtime error '-2147417851 (80010105)';
method 'copyfromrecordset' of object 'Range' failed
can anyone tell me what's wrong?
Dim rs As Recordset
Dim wb As Object
Dim qstr7 As String
Set db = OpenDatabase("c:\stock.mdb
Set wb = GetObject("c:\book1.xls")
qstr7 = " Insert into nice_rpt " _
& "select Description.StockCardNo, Description.Description, Product.Specifications, Received_On.DateReceived, Received_On.QtyReceived, Received_On.UnitPrice, Received_On.BillNumber from Description, Product, Received_On where Description.StockCardNo = Product.StockCardNo and Product.ProductID = Received_On.ProductID order by Product.ProductID "
db.Execute qstr7
Set rs = db.OpenRecordset("nice_rpt
With wb
.Sheets("sheet1").Select
.Sheets("sheet1").Cells.Cl
.Sheets("sheet1").Range("A
.Parent.Windows("book1.xls
.Save
.Close
End With
Set wb = Nothing
Set rs = Nothing
i got a
runtime error '-2147417851 (80010105)';
method 'copyfromrecordset' of object 'Range' failed
can anyone tell me what's wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i tried worksheets(!).range("A2").
and it said xlCenter is a undefine variable