How to identify the position of the cursor in a default table browse?

Sylvia22

New member
Local time
Today, 13:54
Joined
May 3, 2020
Messages
6
As I am new here and this is my first input, at first a warm hello to everybody.
And thanks in advance for helpful tips.

Since I'm not a native speaker: please forgive me when my language is flawed sometimes.

Working with: Access 2010, Version 14.0.7015.1000, 32 Bit on Windows 7
VBA 7.0.1625, Forms3 14.0.4747.100

The question:

In a form "Articles" I integrated an icon. When clicked a little routine is started, its only code

DoCmd.OpenTable "Article", acViewNormal, acReadOnly

Consequently the table is displayed in standard browse mode. As usual I can mark a record there, BUT how can I identify this record via VBA? As to the architecture of Access this display should be some kind of form too, with a form-name to use.

Is it even possible to adress this "form", or need I create an own form for this demand?

The idea behind:

The form "Articles" shows fields of the Table "Article", one record at a time. When switching to the browse mode and positioning on a certain record there, I would appreciate to find this certain record displayed in the form "Articles" when I close the browsing.

Looked around a lot the last hours, but couldn't find any hint. Maybe because I didn't use the right keywords for my problem.
 
Hi Sylvia. Welcome to AWF!

It's considered "best practice" not to give users direct access to tables. Instead of opening the table, you should open a form. By using a form, you can control better what the user can and cannot do, as well as keep track of which record is on the form.
 
Agree with theDBGuy. Users should not work directly with tables and queries. However, what you want might be possible with a global variable or TempVars and table Data Macro.

For more conventional approach to search for record, view http://allenbrowne.com/ser-62.html
 
Hi Sylvia. Welcome to AWF!

It's considered "best practice" not to give users direct access to tables. Instead of opening the table, you should open a form. By using a form, you can control better what the user can and cannot do, as well as keep track of which record is on the form.

Thank you for the Welcome, DBguy 😺

And of course you are right with your principles regarding users. As I used ReadOnly I thought to bypass this problem, but there may be other reasons not to let users see the genuine table.
 
Agree with theDBGuy. Users should not work directly with tables and queries. However, what you want might be possible with a global variable or TempVars and table Data Macro.

For more conventional approach to search for record, view http://allenbrowne.com/ser-62.html
Sounds like a Split Form would do that for you., or even better the Emulated Split Form ?

Thank you for the link June! I gonna work through it. There's always something to learn 👍
 
Thank you for the Welcome, DBguy 😺

And of course you are right with your principles regarding users. As I used ReadOnly I thought to bypass this problem, but there may be other reasons not to let users see the genuine table.
If users freely edit the data directly on a table, you will have none or very limited control over it. On the other hand, using forms gives you the freedom to control or not control what the users can or are doing with the data. In other words, it gives you a choice. In addition, it just makes for a better UI experience.
 
Sounds like a Split Form would do that for you., or even better the Emulated Split Form ?
Sounds like a Split Form would do that for you., or even better the Emulated Split Form ?

Good idea, Gasman! Didn't even think of the split Form. And what an emulated one is, I don't even know, but it sounds interesting and I'm looking forward to get to something new.

As to the code tags: I tried to find some. There is "</>" (Code), but since it doens't include VB or VBA - in an Access forum - I worried this code could create something on its own. Like html-elements. Assume to use "General code" would be the right thing to do? Next time I'll do better ;). Promised.
 
Good idea, Gasman! Didn't even think of the split Form. And what an emulated one is, I don't even know, but it sounds interesting and I'm looking forward to get to something new.

As to the code tags: I tried to find some. There is "</>" (Code), but since it doens't include VB or VBA - in an Access forum - I worried this code could create something on its own. Like html-elements. Assume to use "General code" would be the right thing to do? Next time I'll do better ;). Promised.
I tend to use General, unless I want to colour something to highlight, in which case I use Rich Text
 
While dealing with that problem and the different maybe-solutions, I extended the fieldname for a photo in a form to the .picture of this field. Defined as its source a record-field which contains the name of the source-file for this picture (png-file). To my surprise it worked.

Is this common knowledge and I am the only one who didn't know it?
Never heard or read of it before. Maybe it's ostracized for some reason - but it comes really convenient.
 

Attachments

  • 1588637843839.png
    1588637843839.png
    3.2 KB · Views: 128
I extended the fieldname for a photo in a form to the .picture of this field. Defined as its source a record-field which contains the name of the source-file for this picture (png-file).
I have no idea what you just said, not even sure if it is English, but sounds like it worked. So that is good.
 
While dealing with that problem and the different maybe-solutions, I extended the fieldname for a photo in a form to the .picture of this field. Defined as its source a record-field which contains the name of the source-file for this picture (png-file). To my surprise it worked.

Is this common knowledge and I am the only one who didn't know it?
Never heard or read of it before. Maybe it's ostracized for some reason - but it comes really convenient.
Hi. If you're talking about binding an Image Control, then "Yes." This feature was added back in (I think) Access 2010.
 
It was Access 2007 when ControlSource property was added to Image control. Yes, very handy.
 

Users who are viewing this thread

Back
Top Bottom