Filling in a Textbox without a Query

E

Elena

After many posts, I could not get a simple answer on how to do this. My
co-worker actually figured it out and I thought I would share it.

Here's the code:

Dim First As String

strsql = "Select * from TempTransferAverage where TransferMonth = 10 and
TransferYear = 2004"
Set Oct2004 = CurrentDb.OpenRecordset(strsql)
First = Oct2004!TransferAverage
Me!Text587.ControlSource = "=" + First

Thanks all for your attemps at helping me.
~Elena
 
K

Ken Snell [MVP]

Seems to be a more complex way than you would normally need. A DLookup
function will do this in one simple step, and you can use it as the
ControlSource expression for a textbox:

=DLookup("TransferAverage", "TempTransferAverage", "TransferMonth = 10 And
TransferYear=2004")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top