<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: [AccessD] A2K Reference the dot column property in a query</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>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!</FONT></P>

<P><FONT SIZE=2>Jim Hale</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Arthur Fuller [<A HREF="mailto:artful@rogers.com">mailto:artful@rogers.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Friday, September 05, 2003 10:36 AM</FONT>
<BR><FONT SIZE=2>To: Access Developers discussion and problem solving</FONT>
<BR><FONT SIZE=2>Subject: RE: [AccessD] A2K Reference the dot column property in a query</FONT>
</P>
<BR>

<P><FONT SIZE=2>Here I go with static functions again, Rocky :-)</FONT>
</P>

<P><FONT SIZE=2>IMO it is insane to refer to forms in queries. It ties your hands and makes</FONT>
<BR><FONT SIZE=2>your queries soooo un-reusable. You're on the right track with your public</FONT>
<BR><FONT SIZE=2>function but a static is way better, IMO. You can set it from anywhere,</FONT>
<BR><FONT SIZE=2>including the debug window, and check your query before running it in the</FONT>
<BR><FONT SIZE=2>real app world.</FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: accessd-bounces@databaseadvisors.com</FONT>
<BR><FONT SIZE=2>[<A HREF="mailto:accessd-bounces@databaseadvisors.com">mailto:accessd-bounces@databaseadvisors.com</A>]On Behalf Of Rocky Smolin -</FONT>
<BR><FONT SIZE=2>Beach Access Software</FONT>
<BR><FONT SIZE=2>Sent: Thursday, September 04, 2003 8:51 PM</FONT>
<BR><FONT SIZE=2>To: Access Developers discussion and problem solving</FONT>
<BR><FONT SIZE=2>Subject: Re: [AccessD] A2K Reference the dot column property in a query</FONT>
</P>
<BR>

<P><FONT SIZE=2>I know there must be a solution to this problem but I've never figured it</FONT>
<BR><FONT SIZE=2>out.  Whenever I run into the problem of referencing a form value in a query</FONT>
<BR><FONT SIZE=2>I always make a public function like:</FONT>
</P>

<P><FONT SIZE=2>Public Function GetComboValue</FONT>
<BR><FONT SIZE=2>    GetComboValue=Forms!frmMyForm!cmbMyCombo.Column(2)</FONT>
<BR><FONT SIZE=2>End Function</FONT>
</P>

<P><FONT SIZE=2>Then in the query you can put GetComboValue() and it will return the value.</FONT>
</P>

<P><FONT SIZE=2>Seems there should be a better way though.</FONT>
</P>

<P><FONT SIZE=2>Rocky</FONT>
</P>

<P><FONT SIZE=2>----- Original Message -----</FONT>
<BR><FONT SIZE=2>From: "Darren DICK" <d.dick@uws.edu.au></FONT>
<BR><FONT SIZE=2>To: "AccessD List" <AccessD@databaseadvisors.com></FONT>
<BR><FONT SIZE=2>Sent: Thursday, September 04, 2003 8:34 PM</FONT>
<BR><FONT SIZE=2>Subject: [AccessD] A2K Reference the dot column property in a query</FONT>
</P>
<BR>

<P><FONT SIZE=2>> Hello all</FONT>
<BR><FONT SIZE=2>> In VBA the code to reference certain columns in a combo box on a form</FONT>
<BR><FONT SIZE=2>is...</FONT>
<BR><FONT SIZE=2>> Forms!frmMyForm!cmbMyCombo.Colum(2)  - Cool it all works</FONT>
<BR><FONT SIZE=2>> But when I use the same syntax in a query I get errors - namely</FONT>
<BR><FONT SIZE=2>> Undefined function '[Forms]!frmMyForm!cmbMyCombo.Column' in expression</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> What should I type to reference a particular column of a combo in a query?</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> Many thanks in advance</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> Darren</FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>></FONT>
<BR><FONT SIZE=2>> _______________________________________________</FONT>
<BR><FONT SIZE=2>> AccessD mailing list</FONT>
<BR><FONT SIZE=2>> AccessD@databaseadvisors.com</FONT>
<BR><FONT SIZE=2>> <A HREF="http://databaseadvisors.com/mailman/listinfo/accessd" TARGET="_blank">http://databaseadvisors.com/mailman/listinfo/accessd</A></FONT>
<BR><FONT SIZE=2>> Website: <A HREF="http://www.databaseadvisors.com" TARGET="_blank">http://www.databaseadvisors.com</A></FONT>
<BR><FONT SIZE=2>></FONT>
</P>

<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>AccessD mailing list</FONT>
<BR><FONT SIZE=2>AccessD@databaseadvisors.com</FONT>
<BR><FONT SIZE=2><A HREF="http://databaseadvisors.com/mailman/listinfo/accessd" TARGET="_blank">http://databaseadvisors.com/mailman/listinfo/accessd</A></FONT>
<BR><FONT SIZE=2>Website: <A HREF="http://www.databaseadvisors.com" TARGET="_blank">http://www.databaseadvisors.com</A></FONT>
<BR><FONT SIZE=2>---</FONT>
<BR><FONT SIZE=2>Incoming mail is certified Virus Free.</FONT>
<BR><FONT SIZE=2>Checked by AVG anti-virus system (<A HREF="http://www.grisoft.com" TARGET="_blank">http://www.grisoft.com</A>).</FONT>
<BR><FONT SIZE=2>Version: 6.0.510 / Virus Database: 307 - Release Date: 8/14/2003</FONT>
</P>

<P><FONT SIZE=2>---</FONT>
<BR><FONT SIZE=2>Outgoing mail is certified Virus Free.</FONT>
<BR><FONT SIZE=2>Checked by AVG anti-virus system (<A HREF="http://www.grisoft.com" TARGET="_blank">http://www.grisoft.com</A>).</FONT>
<BR><FONT SIZE=2>Version: 6.0.510 / Virus Database: 307 - Release Date: 8/14/2003</FONT>
</P>

<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>AccessD mailing list</FONT>
<BR><FONT SIZE=2>AccessD@databaseadvisors.com</FONT>
<BR><FONT SIZE=2><A HREF="http://databaseadvisors.com/mailman/listinfo/accessd" TARGET="_blank">http://databaseadvisors.com/mailman/listinfo/accessd</A></FONT>
<BR><FONT SIZE=2>Website: <A HREF="http://www.databaseadvisors.com" TARGET="_blank">http://www.databaseadvisors.com</A></FONT>
</P>

</BODY>
</HTML>