Firing On Current Event For Subdatasheet Form (1 Viewer)

Cronk

Registered User.
Local time
Today, 12:20
Joined
Jul 4, 2013
Messages
2,771
The stop line will only be executed if me.text33 is not 1 or 2 or 3.

If you put the stop as the first line in the OnCurrent event, the code will pause on that line when the current event is triggered.
 

SkyCraw

Registered User.
Local time
Yesterday, 23:20
Joined
Oct 9, 2013
Messages
100
The stop line will only be executed if me.text33 is not 1 or 2 or 3.

If you put the stop as the first line in the OnCurrent event, the code will pause on that line when the current event is triggered.

That just causes the code to halt altogether when I move the cursor to a new record, firing the OnCurrent event.

Code:
    Stop
    If Me.Text33 = 1 Then
        Me.Test_Quote_Options_Sub2.SourceObject = "Test Quote Options Sub2 - 5 Rows"
    ElseIf Me.Text33 = 2 Then
        Me.Test_Quote_Options_Sub2.SourceObject = "Test Quote Options Sub2 - 10 Rows"
    ElseIf Me.Text33 = 3 Then
        Me.Test_Quote_Options_Sub2.SourceObject = "Test Quote Options Sub2 - 15 Rows"
    End If

It also doesn't adjust the subdatasheet's sourceobject to the appropriate one, since it doesn't fire until I move my cursor to the same record I'm trying to expand.

If there was an OnExpand event for subdatasheet forms then I wouldn't have this issue.
 

Cronk

Registered User.
Local time
Today, 12:20
Joined
Jul 4, 2013
Messages
2,771
Yes, the code pauses on the Stop line. That was the aim of the exercise. You can now step through the code by pressing the F8 key to see exactly what the code is doing, or rather not doing.
 

SkyCraw

Registered User.
Local time
Yesterday, 23:20
Joined
Oct 9, 2013
Messages
100
Ah... I see now.

When I step through the code, it all fires as expected but the OnCurrent event still doesn't fire when I click the "+", only when I jump records with my cursor.
 

SkyCraw

Registered User.
Local time
Yesterday, 23:20
Joined
Oct 9, 2013
Messages
100
Marked this thread as solved simply because this workaround inquiry only existed due to poor database designing (also lead to poor database performance). Once I corrected the errors of my ways and had these 15 lines as individual records in another table, instead of 150+ additional columns within the same table, this issue went away.

Regardless, thank you all for your assistance! :)
 

Users who are viewing this thread

Top Bottom