Mark H
Lists at theopg.com
Tue Jul 1 11:38:01 CDT 2003
John I just tried it using Access XP and a recordset and it worked. I created a query with a column called "X" which was the result of a function which multiplies table columns a and c. I then created an adodb.recordset, cycled through the fields and managed to debug.print each fields name. "X" was there... hth Mark -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: 01 July 2003 17:18 To: Access Developers discussion and problem solving Subject: RE: [AccessD] weird query def Interesting idea, though I doubt that will work either. The recordset will get its field list from the querydef, which returns no field list. John W. Colby www.colbyconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Mark H Sent: Tuesday, July 01, 2003 11:02 AM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] weird query def This may be rubbish, but could you create a recordset from the query and then pick up the field names from that instead? Mark -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Colby Sent: Tuesday, July 01, 2003 9:25 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] weird query def I've discovered what the problem is. The query in question uses a function to append City, State and zip into a single string. That function is defined in code in the FE where the query resides. Without that field in the query its fields show up in the query def. With that function in the query, the qureydef thinks it has no fields. This seems pretty strange to me since I am using the code that Gustav provided, opening the FE as a database, setting a qdf from its querydefs collection and manipulating that. You'd think it could see the functions inside the database but apparently not. This is a real show stopper since the wizard needs to be able to grab the query field names to match against the bookmarks in the doc being merged. Bummer! John W. Colby www.colbyconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John Colby Sent: Monday, June 30, 2003 12:57 PM To: AccessD Subject: [AccessD] weird query def I have a weird one. I am opening a query def and reading all of the field names out into a comma delimited string to use as a row source for a combo. All that stuff works. One of the queries in the db I am trying to work on says it has NO fields. If I execute the query I get data. If I look at the querydef itself, I can see the name of the query, the SQL property, etc. But ask it for the .Fields.Count and it comes back 0. Very unsettling since I need to use this method for displaying field names to the user to select to match against document book marks in a mail merge wizard. I compacted / repaired both the wizard as well as the FE that actually holds the query in question. Two other queries that I am performing this operation on work perfectly. One apparently has no fields. John W. Colby www.colbyconsulting.com _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030701/55a1eff3/attachment-0001.html>