Hale, Jim
jim.hale at fleetpride.com
Fri Sep 5 09:17:07 CDT 2003
The last time Arthur posted the code for a static function I got religion. It is a very elegant way to do things. Thanks Arthur! Jim Hale -----Original Message----- From: Arthur Fuller [mailto:artful at rogers.com] Sent: Friday, September 05, 2003 10:36 AM To: Access Developers discussion and problem solving Subject: RE: [AccessD] A2K Reference the dot column property in a query Here I go with static functions again, Rocky :-) IMO it is insane to refer to forms in queries. It ties your hands and makes your queries soooo un-reusable. You're on the right track with your public function but a static is way better, IMO. You can set it from anywhere, including the debug window, and check your query before running it in the real app world. -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Rocky Smolin - Beach Access Software Sent: Thursday, September 04, 2003 8:51 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] A2K Reference the dot column property in a query I know there must be a solution to this problem but I've never figured it out. Whenever I run into the problem of referencing a form value in a query I always make a public function like: Public Function GetComboValue GetComboValue=Forms!frmMyForm!cmbMyCombo.Column(2) End Function Then in the query you can put GetComboValue() and it will return the value. Seems there should be a better way though. Rocky ----- Original Message ----- From: "Darren DICK" <d.dick at uws.edu.au> To: "AccessD List" <AccessD at databaseadvisors.com> Sent: Thursday, September 04, 2003 8:34 PM Subject: [AccessD] A2K Reference the dot column property in a query > Hello all > In VBA the code to reference certain columns in a combo box on a form is... > Forms!frmMyForm!cmbMyCombo.Colum(2) - Cool it all works > But when I use the same syntax in a query I get errors - namely > Undefined function '[Forms]!frmMyForm!cmbMyCombo.Column' in expression > > What should I type to reference a particular column of a combo in a query? > > Many thanks in advance > > Darren > > > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.510 / Virus Database: 307 - Release Date: 8/14/2003 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.510 / Virus Database: 307 - Release Date: 8/14/2003 _______________________________________________ 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/20030905/e3015714/attachment-0001.html>