Count records in Form

L

Lamar

I have form that is based on a table. I need to store the
total number of records being displayed on the form into a
variable.

So if the table has 13 records then I need store that
value. How do you do that in VBA?

Thanks for any help.
 
J

Jonathan Parminter

-----Original Message-----

I have form that is based on a table. I need to store the
total number of records being displayed on the form into a
variable.

So if the table has 13 records then I need store that
value. How do you do that in VBA?

Thanks for any help.
.
Hi Lamar,

myVar=Me.Recordset.RecordCount

Luck
Jonathan
 
S

Steve

Use the Recordset.Recordcount VBA code.

For example, put the following code into your Form Open
event.

Dim iCount as integer
iCount=Recordset.Recordcount

msgBox ICount

That msgBox will enable you to verify if the count is
correct. Delete the msgBox line if all is well.

Good luck.
 

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