Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Tue, 22 Jul 2008 14:47:01 -0700,    group: microsoft.public.access.modulesdaovba        back       


set text box value to result of query   
Using VBA, how do I set the value of a text box control on a form to the 
result of a query that returns one value? I'm sure I knew this at one point, 
but I can't remember and I can't figure it out again. I can do this with a 
combo box by setting the RowSource property to the SQL statement, but I can't 
figure out how to do it for a text box.
date: Tue, 22 Jul 2008 14:47:01 -0700   author:   CuriousMark

Re: set text box value to result of query   
"CuriousMark"  wrote in message 
news:5E7C8E57-4965-4987-AA5B-0C1E138F2304@microsoft.com...
> Using VBA, how do I set the value of a text box control on a form to the
> result of a query that returns one value? I'm sure I knew this at one 
> point,
> but I can't remember and I can't figure it out again. I can do this with a
> combo box by setting the RowSource property to the SQL statement, but I 
> can't
> figure out how to do it for a text box.

Me.TextboxName = Dlookup("FieldName", "QueryName")
date: Tue, 22 Jul 2008 23:28:11 +0100   author:   Stuart McCall

Re: set text box value to result of query   
Thanks. That's perfect!

"Stuart McCall" wrote:

> "CuriousMark"  wrote in message 
> news:5E7C8E57-4965-4987-AA5B-0C1E138F2304@microsoft.com...
> > Using VBA, how do I set the value of a text box control on a form to the
> > result of a query that returns one value? I'm sure I knew this at one 
> > point,
> > but I can't remember and I can't figure it out again. I can do this with a
> > combo box by setting the RowSource property to the SQL statement, but I 
> > can't
> > figure out how to do it for a text box.
> 
> Me.TextboxName = Dlookup("FieldName", "QueryName")
> 
> 
>
date: Tue, 22 Jul 2008 15:59:07 -0700   author:   CuriousMark

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us