On 14 Apr 2006 13:57:01 -0700, Karen Hill wrote:
I'd like to do this:
Me.text_control = "SELECT name FROM customer where [order_id] = 5;"
How is this done. It needs to work for Access versions 2000 and
greater. Thanks in advance for your help.
Use a DLookUp in an UNBOUND text control:
=DLookUp("[NameField]","CustomerTable","[Order_ID] = 5")
Do you really have a field named "Name"?
Name is a reserved Access/VBA/Jet word and should not be used as a
field name.
For additional reserved words, see the Microsoft KnowledgeBase article
for your version of Access:
109312 'Reserved Words in Microsoft Access' for Access 97
209187 'ACC2000: Reserved Words in Microsoft Access'
286335 'ACC2002: Reserved Words in Microsoft Access'
321266 'ACC2002: Microsoft Jet 4.0 Reserved Words'
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail