-----Original Message-----
On your form create another control (a textbox should do).
What they want you to do is assign the value of the new
textbox using a long string (SQL statement) - generated by
the code.
For example purposes we'll call your listbox List1 and the
new textbox Text2. On the menu select View > Code.
Now from the drop-down on the left select List1 and from
the right choose Click (or LostFocus or whatever event you
wish to choose) then Access will create a subroutine.
Inside that subroutine insert the code form the link and
just before the End Sub statement add the following:
Text2.Controlsource = strSQL
When you run this, the text box will get filled with the
string generated by the code. If for example, your List1
is a list of Names, in your query - under the Name column
and in the Criteria row, enter the value for Text2:
[Forms]![Form1]![Text2]
(We are also assuming your form is named Form1 here)
Anyway, once you get it working the way you like, make the
Text2 invisible(hidden) to the users. In form design mode
select the textbox and open the properties dialog box,
then on the Format tab, change Visible to No.
Hope this helps.
jmonty
-----Original Message-----
I have a follow up question about this link. It says to
reference a hidden control to which I assign the code. How
do I do that??
Thanks!!!
Harmony
----------------------------------
Hi,
See if this helps you out:
http://www.mvps.org/access/forms/frm0007.htm
There is no simple way to do it, you have to write some
code.
--
HTH
Dan Artuso, Access MVP
.
.