"Gary" <(E-Mail Removed)> wrote in message
news:E9467F8F-B41C-47DB-AF5F-(E-Mail Removed)...
>I am using Access 2000-2003 on XP Pro OS.
>
> I have a linked table, and there are 3 records in that linked table.
>
> When I try to check on the number of records it only show 1.
>
> This is my VBA Code:
>
> Dim db As Database
> Dim T As DAO.Recordset
> Dim x As Integer
>
> Set db = CurrentDb()
> Set T = db.OpenRecordset("Missing Formations", dbOpenDynaset)
>
> x = T.RecordCount
>
>
> I have tried dbOpenTable, dbOpenSnapshot, etc and they all show 1 record.
> If I change the table from link to a regular table, I see 3 records.
>
> When I open the linked tabe, I see 3 records. I reference are set
> correct
> for DAO. (i.e. DAO 3.6)
For a dynaset-type recordset, the RecordCount property is only reliable when
you have moved to the end of the recordset. Effectively, it's a count of
the records accessed so far, not necessarily the total number of records in
the recordset. If you need to know how many records are in the recordset,
try this:
Set T = db.OpenRecordset("Missing Formations", dbOpenDynaset)
With T
If Not .EOF Then
.MoveLast
.MoveFirst
End If
x = .RecordCount
End With
--
Dirk Goldgar, MS Access MVP
Access tips:
www.datagnostics.com/tips.html
(please reply to the newsgroup)