Solved Moving Focus on a Continuous Form (1 Viewer)

LanaR

Member
Local time
Tomorrow, 07:51
Joined
May 20, 2021
Messages
113
I believe that the normal behaviour of a continuous form, is that when the Record Selector is clicked the focus moves as the mouse button is depressed. All good (y)

What I am trying to achieve is to open a (filtered) pop-up form that is based on the record that has been clicked. I am using the Mouse Up event combined with the Control Key.

The coding all works fine if, and only if, the Control Key is depressed after the record selector has been clicked and before the Mouse button is released. If the Control key is depressed prior to clicking the record selector, the focus remains on the previously selected record. i.e. it does not move to the currently selected record.

Is there a way of circumventing this behaviour?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:51
Joined
May 7, 2009
Messages
19,169
i can't seem to replicate?
 

Attachments

  • controlKey.accdb
    608 KB · Views: 405

LanaR

Member
Local time
Tomorrow, 07:51
Joined
May 20, 2021
Messages
113
Sorry my bad 🥵 I know I wrote continuous form, I should have said Datasheet. You are correct, in continuous view the form does not behave as I described

I've attached a DB
 

Attachments

  • Database6.accdb
    5.1 MB · Views: 275

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:51
Joined
May 7, 2009
Messages
19,169
is it ok if you can click on the Field (using same MouseUp event).
 

Attachments

  • Database6.accdb
    5.1 MB · Views: 444

LanaR

Member
Local time
Tomorrow, 07:51
Joined
May 20, 2021
Messages
113
Yes that does the trick (y)

It also opens up the Double click event, as I'm already using that on the record selector to do something else :)
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:51
Joined
May 7, 2009
Messages
19,169
you are using Ctrl, so i think there is no Conflict with dblClick.
and since your Form is Modal, the form opens and discard
the dbl-click.
 

LanaR

Member
Local time
Tomorrow, 07:51
Joined
May 20, 2021
Messages
113
The posted DB was just for illustration.

On the live DB, I'm using the double click event (on the record selector) to filter another sub form on the same master form. I then decided I wanted to open a pop-up form, which is when I discovered the "quick" that started this thread :) I'll leave the mouse up event, I already have on the record selector, and implement the same procedure on the double click event for the field. Two routes to the same destination :D
 

Users who are viewing this thread

Top Bottom