
Question on old version of VBA for Excel 95
I'm trying to write a macro for Excel 95 (I know its 2001 but I need
to use 95 for this) which pulls data from an Access 95 and plops it
into a spreadsheet.
I have the most up to date version of DAO (3.6 in this case), and when
I run the macro I don't get any error messages. But I have a problem,
because the data always shows up in my database as #N/A!
I set a variable equal to the SQL code, then use this code (sq is the
sequel code using the database):
Set qd = [database variable, already
defined].CreateQueryDef(Name:="", sqltext:=sq)
Set rs = qd.OpenRecordset(dbOpenDynaset)
Then I go through the "rs" recordset and have it put data into the
excel fields, depending on whether the entrees meet certain criteria.
I've tried this using Excel '97 and Excel 2000 and it works fine. Any
ideas??????