S
Samantha R via AccessMonster.com
I am trying to use the EOF function but I don't really know how. My code is:
Public Function CountQuestions() As Integer
Dim recnum As Integer
recnum = 0
DoCmd.OpenTable ("tblqsts")
DoCmd.GoToRecord , , acFirst
Do Until (EOF = True) 'this is where I want to test if tblqsts reaches
the EOF
DoCmd.GoToRecord , , acNext
recnum = recnum + 1
Loop
DoCmd.Close acTable, "tblqsts"
CountQuestions = recnum
End Function
I have tried to do some recordset things but either I was doing it wrong or I
didn't have the correct references. Any help much appreciated.
Public Function CountQuestions() As Integer
Dim recnum As Integer
recnum = 0
DoCmd.OpenTable ("tblqsts")
DoCmd.GoToRecord , , acFirst
Do Until (EOF = True) 'this is where I want to test if tblqsts reaches
the EOF
DoCmd.GoToRecord , , acNext
recnum = recnum + 1
Loop
DoCmd.Close acTable, "tblqsts"
CountQuestions = recnum
End Function
I have tried to do some recordset things but either I was doing it wrong or I
didn't have the correct references. Any help much appreciated.