buzzboychicago
Programmer
- Sep 20, 2004
- 34
Below is some code that I want to use to programatically add data to a table. However, where it says "Insert Calculated Field Here" I want to find the max of the INVOICERESEND table. Not sure what the syntax would be of if I have to use some sort of SQL statement.
Private Sub Command2_Click()
Dim db As Database
Dim rst1 As Recordset
Dim newnumber As Long
Set db = CurrentDb
Set rst1 = db.OpenRecordset("invoiceresend")
rst1.AddNew
rst1!invoice = [INSERT CALCULATED VARIABLE HERE]
rst1.Update
rst1.Close
db.Close
End Sub