I am trying to get the newest date from a table and have it return the record as quickly as possible and feed that date to a textbox.
There are over 200,000 records so I need something that works fast.
My rendition does not work at all. It returns a syntax error of 3075 Syntax Error in Expression.
Private Sub Form_Open(Cancel As Integer)
Dim db As DAO.Database
Dim strDTE As String
Dim recDTE As DAO.Recordset
Set db = CurrentDb()
strDTE = "SELECT Max(sl_date As MxDTE) FROM tblSlip"
Set recDTE = db.OpenRecordset(strDTE, dbOpenDynaset)
If .EOF = False Then
Me.txtEnd = !MxDTE
Set recDTE = Nothing
Set db = Nothing
Any help appreciated.