Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have Query1 in Access, in which one of the fields is a
built-in function, which passes the value of two other fields to a Function on Module1. When I attempt to run the following in Excel VBA, the code bombs: Sub attemptquery() Dim db As DAO.Database, rs As DAO.Recordset Dim rng As Excel.Range, i As Byte Set db = OpenDatabase("C:\a_Sales Tech\Presentations\AAF Reports\db1.mdb") Set rs = db.OpenRecordset("Query1", dbOpenDynaset) <-- BOMBS HERE, CUZ "Query1" HAS A BUILT IN FUNCTION, RELATING TO MODULE1 IN ACCESS!! Set rng = Range("A1") For i = 0 To rs.Fields.Count - 1 rng.Offset(0, i).Range("A1").Value = rs.Fields(i) Next i rs.Close Set rs = Nothing db.Close Set db = Nothing Set rng = Nothing End Sub Thank You. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find the oldest date in an Access recordset | Excel Discussion (Misc queries) | |||
is there any built in function to draw lines | Excel Worksheet Functions | |||
Sqr built-in function in Excel 2003 VBA | Excel Discussion (Misc queries) | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming | |||
Access a built-In command? | Excel Programming |