Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Execute sub from Module X as part of code for Form A

Status
Not open for further replies.

KUZZ

Technical User
Aug 13, 2002
254
GB
this is a portion of the code from my form
============================================
' NEW JOBORDER

If Text14 = "STRT" Then
If Left(Text16, 2) = "CI" Or Left(Text16, 2) = "CP" Or Left(Text16, 2) = "C2" Or Left(Text16, 4) = "PROT" Or Left(Text16, 4) = "PROD" Then

?????????????????????????????????????????

If TOTRECS <> 0 Then
MsgBox &quot;THERE ARE &quot; & TOTRECS & &quot; JOBORDERS OPEN&quot;, vbOK + vbExclamation
Exit Sub
End If

DoCmd.GoToRecord , , acNewRec
If Text16 = &quot;PRODUCTION&quot; Or Text16 = &quot;PROTOTYPING&quot; Then
[JO#] = Text16
Else
[JO#] = Mid(Text16, 2)
End If
CI = Text16
MSETUOPER = Text12
JOST = &quot;OPEN&quot;
INI = Text12
CO = Text12
TAR = &quot; &quot;
[tblTIME.PT#] = [tblACTIONS.PT#]
[tblTIME.REV] = &quot; & [tblACTIONS.REV] & &quot;
Text12.SetFocus
===================================================



where you see many ?????'es i want to calculate a value TOTRECS by running sub from my module called ommon_operations, here is the sub


============================================

Public sub ACTIVE_JO_COUNT()

reccnt = Text209
OPNrecs = 0
TOTRECS = 0
Forms!TIMECAPTURE.SetFocus

DoCmd.GoToRecord , , acFirst
While reccnt > 0
If INI = Text12 Then

If ((MRUNST > MRUNEND) Or (Format(MRUNST, &quot;@&quot;) <> &quot;&quot; And Format(MRUNEND, &quot;@&quot;) = &quot;&quot;)) Or ((MSETST > MSETEND) Or (Format(MSETST, &quot;@&quot;) <> &quot;&quot; And Format(MSETEND, &quot;@&quot;) = &quot;&quot;)) Or ((FINST > FINEND) Or (Format(FINST, &quot;@&quot;) <> &quot;&quot; And Format(FINEND, &quot;@&quot;) = &quot;&quot;)) Or ((PNTST > PNTEND) Or (Format(PNTST, &quot;@&quot;) <> &quot;&quot; And Format(PNTEND, &quot;@&quot;) = &quot;&quot;)) Then

OPNrecs = 1 + OPNrecs

End If

TOTRECS = 1 + TOTRECS

End If

reccnt = reccnt - 1
DoCmd.GoToRecord , , acNext

Wend

so what do I have to write in the line instead of ??????????
so that the calculation of TOTORECS will take place and then the value would be used further in the code of my form A.
Good luck,
Kuzz

&quot;Time spent debating the impossible subtracts from the time during which you
can try to accomplish it.&quot;


Good luck,
Kuzz

&quot;Time spent debating the impossible subtracts from the time during which you
can try to accomplish it.&quot;
 
I think the command you are looking for is CALL.

IE:

Call ACTIVE_JO_COUNT()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top