value to textbox

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

Hi

I have the code below on my database. It gives me the highest value in my
table. How do I drop that value into a textbox on screen?

Thanks


Dim rst22 As ADODB.Recordset

Set rst22 = New ADODB.Recordset
With rst22
.ActiveConnection = CurrentProject.Connection
.CursorLocation = adUseClient
.CursorType = adOpenDynamic
.LockType = adLockOptimistic
.Open "SELECT Max(InvoiceSum.InvNumber) AS MaxOfInvNumber FROM
InvoiceSum"
End With

rst22.Close
 
Back
Top