|
-
Aug 24th, 2004, 10:47 AM
#1
Thread Starter
Member
[Resolved] Beginner's question
I have a form in datasheet view and am trying to write some VB to go with it. Two questions:
1) Is there a property for which record the cursor is sitting in that I can refer to in the code?
2) Can I write code such that when I click on a record it highlights the whole line (as if I had clicked on the grey square to the left of it)
Thanks v much for your help
Last edited by jrpfinch; Aug 24th, 2004 at 12:46 PM.
-
Aug 24th, 2004, 11:25 AM
#2
I take it that you are using Access. For the first question, I think
the event is "Private Sub Form_Current()". Not too sure because
I know it works for a form in Form view. So for Datasheet view ?
For the second question I dont think so.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 24th, 2004, 11:33 AM
#3
Thread Starter
Member
Sorry I think I must have phrased the question wrongly
1) How can I identify which record the cursor is in on a form which has a datasheet in it? (I'm guessing it's something like frmMain.ActiveRecord or similar)
-
Aug 24th, 2004, 11:46 AM
#4
Will give you the record that the user has the cursor in. If you
click on a record you will see the data control change its position.
For example if you have 50 records total and you click on the 25th
record then the data control change to say "25 of 50 Records".
So thats why I thought that the Current event would give you
the info. These properties also should help you get what you
want.
Me.CurrentRecord
Me.CurrentSectionLeft
Me.CurrentSectionTop
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 24th, 2004, 12:47 PM
#5
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|