Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strsql = "SELECT MAX(Date) did not work... 1

Status
Not open for further replies.

childrenfirst

Technical User
Oct 15, 2006
80
US
Hi,

This is probably too simple for all of you, but I just can't figure it out.

I have a textbox,txtLastImportDate, which should display the last data import date based on the records in the column, ImportDate, in a SQL table called AppImportDate.

In Access, I wrote a module in form_load:

Dim strLastImportDate As String

strLastImportDate = "SELECT MAX(ImportDate) FROM AppImportDate"
Me.txtLastImportDate.Value = strLastImportDate

The code is not working (it shows "SELECT MAX(ImportDate)... in the textbox currently), and any advice will be greatly appreciated!



 
Me!txtLastImportDate = DMax("ImportDate", "AppImportDate")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hello PHV,

You are an incredible programmer!

Here are the stars for the super star:) Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top