By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,829 Members | 670 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,829 IT Pros & Developers. It's quick & easy.

Count Selected record in datasheet

P: 1
Hi everyone, I'm new here

I work in access 2003 and i'm searching since too much time how to count the number of lines selected by the user in datasheet view

Does anyone have an idea to do so ?
Jun 6 '12 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 10K+
P: 14,534
On the MouseUp Event of the form put the following code ...
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  2. Dim RowCount As Integer
  4.     RowCount = Me.SelHeight
  5.     Msgbox RowCount, vbOKOnly
  7. End Sub
For example, if you select row 3 and drag the mouse to row 7, then the Msgbox will popup with 5.
Jun 12 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.