Text Box on Form

K

Kirk P.

I would like to place a text box on my Switchboard form that displays the
import date field contained in tblCombinedData. I've got a SQL statement
that retrieves the import date from tblCombinedData, but the query takes too
long and delays the opening of the form.

I thought a better option was some VBA that simply retrieved the first
record in tblCombinedData for the ImportDate field. This would contain the
information I need. What code would I need, and what event would I use to
display the import date in a text control upon opening of the switchboard
form?
 
T

T Martin

Kirk P.,

Use "On Open" Event on your form:

dim rst as Recordset
set rst = currentdb.openrecordset( "Select ... 'Your SQL statement
here)
me.textbox = rst!importdate

this should do it.

T Martin
 

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