R
Ramone
I was looking for help with the following code.
I would like to count the agents hired after 2002 and
were hired directly
Dim hiretype As Text
Dim agntct As Integer
Dim dbs As Database, rst As Recordset
hiretype = "Direct"
agntct = DCount("[Agent Hire
Date]", "tblAgentdetail", "[Hire Type]= '" & hiretype
& "' and [Hire Date]> #12/31/2002# ")
' Return reference to current database.D
Set dbs = CurrentDb
' Open table-type Recordset object.
Set rst = dbs.OpenRecordset("TestAG")
rst.AddNew
rst.Fields("Year 1").Value = agntct
rst.Update
rst.Close
Set dbs = Nothing
End Sub
Thanks in advance
I would like to count the agents hired after 2002 and
were hired directly
Dim hiretype As Text
Dim agntct As Integer
Dim dbs As Database, rst As Recordset
hiretype = "Direct"
agntct = DCount("[Agent Hire
Date]", "tblAgentdetail", "[Hire Type]= '" & hiretype
& "' and [Hire Date]> #12/31/2002# ")
' Return reference to current database.D
Set dbs = CurrentDb
' Open table-type Recordset object.
Set rst = dbs.OpenRecordset("TestAG")
rst.AddNew
rst.Fields("Year 1").Value = agntct
rst.Update
rst.Close
Set dbs = Nothing
End Sub
Thanks in advance