Matt Brown
Registered User.
- Local time
- Today, 16:54
- Joined
- Jun 5, 2000
- Messages
- 120
DAO Query problem, please help anyone!
Why does Access through up an "item not found in this collection" error when i run this?
When i remove the Max() it works.
I need to get the Max Serial number out of the Quotes table.
Any help appreciated.
Matt
Why does Access through up an "item not found in this collection" error when i run this?
When i remove the Max() it works.
I need to get the Max Serial number out of the Quotes table.
Code:
Private Sub Command0_Click()
Dim db1 As DAO.Database
Dim rs1 As DAO.Recordset
Dim SerialNo As Integer
Dim SQL As String
Set db1 = CurrentDb()
SQL = _
"SELECT MAX(SerialNo) " & _
" FROM Quote " & _
" where (CustomerNo) = 'MCT35' "
Set rs1 = db1.OpenRecordset(SQL, dbOpenSnapshot)
TEST1 = rs1.Fields("SerialNo")
rs1.Close
End Sub
Any help appreciated.
Matt