473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Determining which Record with VB

If I have a form open with a subform control on it in datasheet view that
has its record source set to a query or a table, is it possible to determine
which record the user has clicked into with VB? I don't mean the text box
with which you can determine the field/column, but the record (row). I
guess what I'm looking for would be the bookmark? (or some line numbering?)
or whatever information would aid in determining unambiguously which record
in the underlying table was being accessed.

Hope that makes sense. Any pointers would help as I have a couple of books
I can refer to and the online help to work out the details.

Thanks,

Gord

P.S. I'm using Access 2007
Oct 14 '08 #1
3 2211
Gord wrote:
If I have a form open with a subform control on it in datasheet view that
has its record source set to a query or a table, is it possible to determine
which record the user has clicked into with VB? I don't mean the text box
with which you can determine the field/column, but the record (row). I
guess what I'm looking for would be the bookmark? (or some line numbering?)
or whatever information would aid in determining unambiguously which record
in the underlying table was being accessed.

Hope that makes sense. Any pointers would help as I have a couple of books
I can refer to and the online help to work out the details.

Thanks,

Gord

P.S. I'm using Access 2007

You might want to check out AbsolutePosition and any code examples in help.
Oct 14 '08 #2
Thanks Salad,

That may be part of the solution but I think I'm still missing something
important before I can use that property.

I assume that when a query is run (or even just opening a table in datasheet
view I would think) that Access must create its own recordset to display the
records in that datasheet. It would be that recordset that I need to get
ahold of in code to work with. I tried setting my own recordset to the same
query as to what the subform datasheet is set to display but it would appear
the datasheet and my recordset are not 'linked'. For example, in the click
event in one the fields/columns textbox I displayed a message box to display
the value in that field. If I clicked in different records/rows, I get the
same value displayed as the first record. So the 'current record' in my
recordset is not responding to where I click on the datasheet.

I hope that gives the idea of where I'm coming from. In short, I can't
(don't know how) to detect which row has been clicked in code. The
AbsolutePosition property would seem to be a property of a recordset. I
don't know where this recordset is or how to create it?

Thanks,

Gord

"Salad" <oi*@vinegar.comwrote in message
news:sZ******************************@earthlink.co m...
Gord wrote:
>If I have a form open with a subform control on it in datasheet view that
has its record source set to a query or a table, is it possible to
determine which record the user has clicked into with VB? I don't mean
the text box with which you can determine the field/column, but the
record (row). I guess what I'm looking for would be the bookmark? (or
some line numbering?) or whatever information would aid in determining
unambiguously which record in the underlying table was being accessed.

Hope that makes sense. Any pointers would help as I have a couple of
books I can refer to and the online help to work out the details.

Thanks,

Gord

P.S. I'm using Access 2007
You might want to check out AbsolutePosition and any code examples in
help.

Oct 14 '08 #3
"Gord" <x1******@telus.netwrote:
>If I have a form open with a subform control on it in datasheet view that
has its record source set to a query or a table, is it possible to determine
which record the user has clicked into with VB? I don't mean the text box
with which you can determine the field/column, but the record (row). I
guess what I'm looking for would be the bookmark? (or some line numbering?)
or whatever information would aid in determining unambiguously which record
in the underlying table was being accessed.
Is the primary key of the record sufficient? If so please that on the subform and
make it hidden. When the user sets the focus to a record then the field will be
that value.

But I suspect that's not what you mean.

What is your objective?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Oct 14 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: glakk | last post by:
I have a problem of migrating a database from one host to another. I can't do a dump on the source server. The only access I have is thru queries. So it looks like I'm going to have to query all...
66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
18
by: DartmanX | last post by:
Is there a simple way to determine if someone using Internet Explorer has completely disabled ActiveX controls? Jason
2
by: Ryan | last post by:
Access97 I hope someone out there can help. This is driving me crazy. Basically, I am trying to recreate VBA's built in navigation feature (The one that allows you to move first, next,...
10
by: Lyn | last post by:
I have a form set to Single Form mode with which I can cycle through the records in a table via Next and Previous buttons. To avoid users pressing the Previous button on the first record and the...
0
by: Brian Graham | last post by:
I have a database that someone else put together to maintain. Security is handled via group membership in the System.mdw file. Some groups have data deletion rights to a particular table while other...
7
by: todholt | last post by:
Hello, I am trying to bypass a form's automatic update, and instead call a stored procedure in sql server. I am using continuous forms. The problem I am having is with returning to the next...
5
by: Nathan Sokalski | last post by:
I have a DataList that I was having trouble getting the events for. After a bit of help, I realized that I needed to put the databinding inside an If Not IsPostBack() condition. Although this fixed...
1
by: Robert | last post by:
I have a form that has a table; tblProjects; as its record source. The form is filtered, however, by two combo boxes in the header. One allows the user to select a client, the other a project for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.