Run Several sub functions

ds0203

Registered User.
Local time
Today, 00:37
Joined
Feb 22, 2007
Messages
14
Greetings - I'm hoping someone can help me with this.

I have a form with a button that on the click I want to run a couple of action queries followed by 6 sub functions that I already have written. I have the click event set up and the code needed to run the SQL for the action queries, but I can't get it to call the sub functions and run them. I know I have the writing of that part of the code incorrect - can someone give me the correct format?

Thanks in advance, I really appreciate it.
ds
 
Please could you post the code you use for running your action queries...
 
This is what I have for running the action queries:

Private Sub cmdCreateTemplate_Click()
Dim SQL As String

SQL = "INSERT INTO tblTasks_Group ( TaskID, CountofCitations, TaskTitle ) " & _
"SELECT TblTaskCitations.TaskID, Count(TblTaskCitations.TaskID) AS CountOfTaskID, tblTasks.[Task Statement] " & _
"FROM tblTasks INNER JOIN TblTaskCitations ON tblTasks.TaskID = TblTaskCitations.TaskID " & _
"GROUP BY TblTaskCitations.TaskID, tblTasks.[Task Statement]; " & _
"INSERT INTO tblRulesMap ( TaskID, TaskTitle, CountofCitation, Rule, RequirementCitation ) " & _
"SELECT tblTasks_Group.TaskID, tblTasks_Group.TaskTitle, tblTasks_Group.CountofCitations, TblTaskCitations.Rule, TblTaskCitations.[Requirement Citation] " & _
"FROM tblTasks_Group INNER JOIN TblTaskCitations ON tblTasks_Group.TaskID = TblTaskCitations.TaskID; " & _
"INSERT INTO TaskUploadTemplate ( ID, [Assigned Entity], [Task Statement], [Task Description], [Apply Continual/Event Driven Prefix], [Enable Deviation Tracking], [Tracked vs Untracked], [Initial Due Date], [Task Frequency], [Use Default Email Notifications], [Task Owner - Individual], [Task Owner - Team], [Task Supervisor - Individual], [Task Initiator - Individual], [Task Supervisor - Team], [Task Group - Legal vs Monitoring], [Task Group - Contractor Performed], [Task Group - Legally Required Training], [Task Group Other 1], [Task Group Other 2], [Task Group Other 3] ) " & _
"SELECT tblTasks.TaskID, tblTasks.Enterprise_Entity, tblTasks.[Task Statement], tblTasks.[Task Description], tblTasks.[Apply Continual/Event Driven Prefix], tblTasks.[Enable Deviation Tracking], tblTasks.[Tracked vs Untracked], tblTasks.[Initial Due Date], tblTasks.[Task Frequency], tblTasks.[Use Default Email Notifications], tblTasks.[Task Owner - Individual], tblTasks.[Task Owner - Team], tblTasks.[Task Supervisor - Individual], tblTasks.[Task Initiator - Individual], tblTasks.[Task Supervisor - Team], tblTasks.[Task Group - Legal vs Monitoring], tblTasks.[Task Group - Contractor Performed], tblTasks.[Task Group - Legally Required Training], tblTasks.[Task Group Other 1], tblTasks.[Task Group Other 2], tblTasks.[Task Group Other 3] " & _
"FROM tblTasks; "
DoCmd.RunSQL SQL


End Sub


This part is working, I just need to add some code at the end for running the following sub functions that I have written:
Sub zerolength()
Sub RulesNumberingAndPaste()
Sub OperationalControlsPaste()
Sub DumpAOPRules()
Sub CountTotalRules()
--All of these subs are in a module called modRulesandOpControlsCode

Can you help me with the code needed to call or run these 5 subs?

Thanks!
 
Try

call zerolength()
call RulesNumberingAndPaste()
call OperationalControlsPaste()
call DumpAOPRules()
call CountTotalRules()
 
Re: Run Several sub functions - Another Problem

Thank you so much for your help. Now I'm experiencing a new problem. I run the code and everything appends/updates exactly as it is supposed to. But then I go into one of my forms (to add in additional data) and the entire database closes. All of the remaining tables, queries, forms are able to be opened, but the one particular form (which is our main form we use for data entry) bombs out. Does anyone have any idea why?
 
It would be a good idea to start a new thread and give a better description of your problem.
 

Users who are viewing this thread

Back
Top Bottom