brunces
Registered User.
- Local time
- Today, 17:40
- Joined
- Sep 12, 2004
- Messages
- 45
Friends,
Please, how can I create a VBA code which counts the number of records loaded in a form?
In a form (TextBox), I can use ... Count(*) ... but when it comes to VBA code, this doesn't work.
I also cannot use ... DCount("*", "Table") ... because this form is opened from a button in another form which contains filters, so that DCount wouldn't bring me the exact number of loaded records only.
So, what I really need is something like this:
I hope you can help me. Thank you very much for your attention.
Hugs,
Bruno
Please, how can I create a VBA code which counts the number of records loaded in a form?
In a form (TextBox), I can use ... Count(*) ... but when it comes to VBA code, this doesn't work.
I also cannot use ... DCount("*", "Table") ... because this form is opened from a button in another form which contains filters, so that DCount wouldn't bring me the exact number of loaded records only.
So, what I really need is something like this:
Code:
Private Sub MyButton_Click()
Dim varTotal As Integer
varTotal = (Code for counting the number of records loaded in this form)
MsgBox "Number of loaded records: " & varTotal
End Sub
I hope you can help me. Thank you very much for your attention.
Hugs,
Bruno