General discussion

Locked

Differentiate ADODC.MoveNext source?

By ohJani ·
How do i know the ADODC.Recordset.MoveNext is fired from the my code ie:

if ADODC.Recordset("RefNo").Value <> 0 then
ADODC.Recordset.MoveNext

OR it is fired from the event where user has actually pressed the Next button in ADODC?

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
Thread display: Collapse - | Expand +

All Comments

Collapse -

Differentiate ADODC.MoveNext source?

by sl-campbell In reply to Differentiate ADODC.MoveN ...

Use the event: ADODC_MoveComplete

In the code window click on the left DropDown and select the name of your datacontrol, and in the right DropDown select MoveComplete.
The ADODB.EventReasonEnum returns adRsnMoveNext (value 13) in the variable adReason to identify that the action was MoveNext and the ADODB.EventStatusEnum returns adStatusOK (value 1) in the variable adStatus if the move was successful.

You could also do this by comparing the AbsolutePosition property:

Dim lPrevPos As Long
if ADODC.Recordset("RefNo").Value <> 0 then
lPrevPos = ADODC.Recordset.AbsolutePosition
ADODC.Recordset.MoveNext
if ADODC.Recordset.AbsolutePosition <>lPrevPos then
'repositioned - new record
End If

Collapse -

Differentiate ADODC.MoveNext source?

by ohJani In reply to Differentiate ADODC.MoveN ...

i know how to do a MoveNext, but i want to differentiate whether the MoveNext event is triggered from my code (ie: ADODC.Recordset.MoveNext) or the event is triggered from the action from user (ie: pressed the MoveNext button on the datacontrol)

Collapse -

Differentiate ADODC.MoveNext source?

by ohJani In reply to Differentiate ADODC.MoveN ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums