T
Tom
Hello there
I have a subroutine which has vba code. But the issue
is if i want to run another code (from a diffrent form)
from that subroutine, how i can do that. One way is that i
write the label name in the main subroutine
e.g. Following is the main subroutine
Dim varX As Variant
If Len(Nz(Forms![output print selection]!P_Name, "")) = 0
Then
varX = DLookup("[F_Flag]", "Flag Support")
Else
varX = DLookup("[F_Flag]", "Flag Support", "[P_Name]
='" & Forms![output print selection]!P_Name & "'")
End If
If varX = 0 Then
Else
MsgPrint2 = "Please run the calculation engine first!"
MsgBox MsgPrint2, style, Title
GoTo Exit_Command70_Cl
MsgBox MsgPrint2, style, Title
GoTo Exit_Command70_Click
Now if i want to call another subroutine which is in a
diffrent form than i can write a code like
(the above code would remain the same just last couple of
line changes as follows
If varX = 0 Then
Else
GoTo Exit_Command35_Click
Now if i do that, it shows the error that label is not
defined. How can i define a label which is in a diffrent
form and diffrent subroutine.
I would appreciate if somebody woulc help me on the issue.
Thank you.
I have a subroutine which has vba code. But the issue
is if i want to run another code (from a diffrent form)
from that subroutine, how i can do that. One way is that i
write the label name in the main subroutine
e.g. Following is the main subroutine
Dim varX As Variant
If Len(Nz(Forms![output print selection]!P_Name, "")) = 0
Then
varX = DLookup("[F_Flag]", "Flag Support")
Else
varX = DLookup("[F_Flag]", "Flag Support", "[P_Name]
='" & Forms![output print selection]!P_Name & "'")
End If
If varX = 0 Then
Else
MsgPrint2 = "Please run the calculation engine first!"
MsgBox MsgPrint2, style, Title
GoTo Exit_Command70_Cl
MsgBox MsgPrint2, style, Title
GoTo Exit_Command70_Click
Now if i want to call another subroutine which is in a
diffrent form than i can write a code like
(the above code would remain the same just last couple of
line changes as follows
If varX = 0 Then
Else
GoTo Exit_Command35_Click
Now if i do that, it shows the error that label is not
defined. How can i define a label which is in a diffrent
form and diffrent subroutine.
I would appreciate if somebody woulc help me on the issue.
Thank you.