Can I get a record count of this???

S

Southern at Heart

Function Phone_List() As Recordset
'This opens a recordset from the Table [Name]
'This recordset contains records that have 3 or more phone #'s
Dim strSQL As String
strSQL = "SELECT Name.Name, Name.Phone " & "FROM Name " & _
"WHERE (((Name.Phone) Like ""*"" & Chr(13) & Chr(10) & ""*"" & Chr(13) &
Chr(10) & ""*""));"
Set Phone_List = CurrentDb().OpenRecordset(strSQL)
End Function
 
J

John W. Vinson

Function Phone_List() As Recordset
'This opens a recordset from the Table [Name]
'This recordset contains records that have 3 or more phone #'s
Dim strSQL As String
strSQL = "SELECT Name.Name, Name.Phone " & "FROM Name " & _
"WHERE (((Name.Phone) Like ""*"" & Chr(13) & Chr(10) & ""*"" & Chr(13) &
Chr(10) & ""*""));"
Set Phone_List = CurrentDb().OpenRecordset(strSQL)
End Function

Sure.

Phone_List.MoveLast ' ensure that the entire recordset has been accessed
Debug.Print Phone_List.RecordCount

The recordcount will (usually) be equal to either 0 (if there are no records
returned at all) or 1 immediately after opening; if you're just checking to
see if there are ANY records you can skip the MoveLast and just check to see
if it's >0.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top