Text Box on Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
Back
Top