Ok, all I want to do is perform an SQL query in access to count the number of records in a query and return that to an integer. I want to run an SQL query like:
The problem is... Access hates me and won't let me run something like that.
Does anyone know how to solve this one?
Code:
Dim SQL as string
Dim RecordCount as integer
SQL = "SELECT COUNT(TrackID) FROM tracks WHERE FacilityID = " & FacilityID.Value
RecordCount = DoCmd.RunSQL SQL, 0
MsgBox RecordCount
The problem is... Access hates me and won't let me run something like that.
Does anyone know how to solve this one?