Newbie question 
Author Message
 Newbie question

This must be simple but I just can't seem to figure it out. Any help
is greatly appreciated. I'm using a DataGrid bound to an ADODC data
control connected to a simple Access database. I know that by
selecting an entire row on the grid I can determine which record is
being "pointed to" by the user. What I CAN'T figure out is how to make
that determination if the user only clicks (or moves) into a single
cell on the grid.
I've looked at the help on BOOKMARKS but (and this must be the part
I'm really missing) it seems they only tell me which record I've come
FROM, not the record I've gone TO. And I can't seem to find anything
in the help files that tells/shows me how to know which record I'm
currently "on."
The RECORDSET bookmarks don't seem to do that either unless the entire
row is selected.
I hope this is stated clearly enough for you helpful folks to figure
out what I mean. If not just respond and I'll try to clarify. TIA
again for any help offered.


Thu, 24 May 2001 03:00:00 GMT  
 Newbie question
Ron,
I may be missing something, but if you use
    ADODC1.Recordset![FieldName]
you will get the data in the field of the record you are on, no matter
which column you are in.  As far as which "record" is selected, you can
use
    ADODC1.Recordset.AbsolutePostion
to return a "record number".

Let me know if this is not what you are asking for.

Matt Ridge

Quote:

> This must be simple but I just can't seem to figure it out. Any help
> is greatly appreciated. I'm using a DataGrid bound to an ADODC data
> control connected to a simple Access database. I know that by
> selecting an entire row on the grid I can determine which record is
> being "pointed to" by the user. What I CAN'T figure out is how to make
> that determination if the user only clicks (or moves) into a single
> cell on the grid.
> I've looked at the help on BOOKMARKS but (and this must be the part
> I'm really missing) it seems they only tell me which record I've come
> FROM, not the record I've gone TO. And I can't seem to find anything
> in the help files that tells/shows me how to know which record I'm
> currently "on."
> The RECORDSET bookmarks don't seem to do that either unless the entire
> row is selected.
> I hope this is stated clearly enough for you helpful folks to figure
> out what I mean. If not just respond and I'll try to clarify. TIA
> again for any help offered.



Fri, 25 May 2001 03:00:00 GMT  
 Newbie question
Matt,
Thanks for your reply, but I should have mentioned I tried
AbsolutePosition and it didn't really do what I was looking for. For
example, the following dbGrid:

        Col1    Col2    Col3
Row1    Rec11   Rec12   Rec13
Row2    Rec21   Rec22   Rec23
Row3    Rec31   Rec32   Rec33
Row4    Rec41   Rec42   Rec43
Row5    Rec51   Rec52   Rec53

"Cell" Rec21 selected (highlighted).
User clicks inside cell Rec51.
AbsolutePosition returns 2 -- the place we came from.
User clicks inside cell Rec51 again.
AbsolutePosition now returns 5 -- where we are.
Something must be going on to indicate where the cell pointer is
positioned, so my question: How do I get at that something?
In other words, how can I determine which dbGrid ROW "owns" the
currently selected (highlighted) cell?
Thanks for your patience and assistance.
Ron



Sat, 26 May 2001 03:00:00 GMT  
 Newbie question
I used this to get the current row the user has clicked on(assuming you are
using a data control).This was found on the knowledge base site(Q191803).

Private Sub Data1_Reposition()
         Debug.Print "Data1_Reposition Value=" & DBGrid1.Columns(0).Value
End Sub

Hope this helps.

Quote:

>Matt,
>Thanks for your reply, but I should have mentioned I tried
>AbsolutePosition and it didn't really do what I was looking for. For
>example, the following dbGrid:

> Col1 Col2 Col3
>Row1 Rec11 Rec12 Rec13
>Row2 Rec21 Rec22 Rec23
>Row3 Rec31 Rec32 Rec33
>Row4 Rec41 Rec42 Rec43
>Row5 Rec51 Rec52 Rec53

>"Cell" Rec21 selected (highlighted).
>User clicks inside cell Rec51.
>AbsolutePosition returns 2 -- the place we came from.
>User clicks inside cell Rec51 again.
>AbsolutePosition now returns 5 -- where we are.
>Something must be going on to indicate where the cell pointer is
>positioned, so my question: How do I get at that something?
>In other words, how can I determine which dbGrid ROW "owns" the
>currently selected (highlighted) cell?
>Thanks for your patience and assistance.
>Ron



Sun, 27 May 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Newbie question: Session_OnEnd question

2. Resizing forms question (newbie question)

3. Access97 VBA newbie question

4. Newbie Question: Understanding Syntax

5. Newbie question:

6. Newbie Questions About DAO Queries to SQL Server

7. Brand newbie questions

8. Newbie question

9. Newbie question: open file

10. vba Newbie Question

11. Newbie Question: Getting the Values from Calculated controls into a table

12. Newbie question for calling functions

 

 
Powered by phpBB® Forum Software