Q for Stephen Lebans: How do I use your ContinuousFormsCurrentRow code?

  • Thread starter Thread starter Brainlord Mesomorph
  • Start date Start date
B

Brainlord Mesomorph

Me again. So far I've been pretty good at reverse-engineering your forms and
code and making it work in my stuff, (I do that a lot) but here I'm stumped.

I'm working with a version of Drag and Drop code I got from the MS website
(example Forms MDB). Its basically 4 subs: DragStart and DragStop which you
attach to the MouseDown and MouseUp events of the control you want to drag ,
DropDetect on the MouseMove of the control you want to drop on, and if all
those fire, (ie. the user has dragged and dropped) a fourth sub, DragDrop,
fires and receives all the values from the other subs (and both forms) as
in:

DragDrop(DragForm, DragCtl, DragVal, DropForm, DropCtl, DropVal, X,Y,
Button, Shift)

then using SelectCase with the names of the forms and/or controls we can
make various things happen to the make Drag and Drop do things, different
things depending on what the user dragged and where he dropped.

But you're ahead of my here (because you read the Subject of this post) and
you know that DragDrop doesn't work when you drop on Continuous Forms. The
DropValue the sub receives is the value in the DropControl of whatever Row
happen to have focus last, *not* the one the user is mousing over at the
time.

Now your ContinuousFormCurrentRow code has shown me that its possible to
know what row the user is mousing over, but I'll be damned if I can figure
out how to use it.

I've looked at the form and the code and there doesn't seem to be any
mousing events being used. I'm not looking you constantly update a control
on the screen here, I just need to know the CurrentRow at the moment the
Drop happens, on MouseUp (so I can get the right DropVal)

Am I explaining this right? can you help me?

aha tia
blm
 
Not sure where you are having trouble with this. THe clsControlData
class module contains several methods. It uses WithEvents to sink the
TextBox control's MouseMove event. THe Sub that calcs the current row
the cursor is over is named:
ctlTextBox_MouseMove

In your case though perhaps you are looking at the wrong example. I
added sample code to show how to use Conditional Formatting in A2K or
higher to simulate a mouse hover effect as the users moves their mouse
over the rows in a form set to Continuous view. I think this sample will
be much easier for you to modiy to your specific needs.
http://www.lebans.com/conditionalformatting.htm
The sample Form is named "ContinuousFormsCurrentRowHover"
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Thanks that code is much more on topic.

And I have it working, sort of.

I can put GetCurrentRow() at the right point in my drag and drop operation,
and it does give me the right row number, but I really don't need row number
I need the ID number of that record.

so right now I'm using (an admittedly awkward) docomd.gotorecord to move the
focus (!) to the right record and grab its ID number.

wouldn't there be a better way to do what I'm doing?

thanks agian
blm
 
Just look at my source code. I use the rownumber to index into the
Recordsetclone and retreive the values of the fields for this row. It's
very straightforward.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top