473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Module help

I have a huge chunk of if statements that I am trying to put into a module. I have one created with the if statements in there for the code. It is a function called GetSQL and I am trying to pass 9 variables to it and then get a string out of it. But every time I try to call it using IncSQL = GetSQL( ...) it says "Sub or Function not Defined) Can anyone help me. I have never created a module before so I need lots of help.
Nov 20 '07 #1
2 1138
Here is my code


Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.Database
  2. Dim rs As DAO.Recordset
  3. Dim qd As DAO.QueryDef
  4. Dim rst As DAO.Recordset
  5. Dim DateSQL, PostSQL, PDSQL1, PDSQL2, PDSQL3, PDSQL4, PDSQL5, PDSQL6, PDSQL As String
  6. Dim FormSQL1, FormSQL2, FormSQL3, IncSQL As String
  7.  
  8.  
  9. 'ProjEA, ProjName, Phase, CountyCheck, RouteCheck, Begin, Ending
  10.  
  11. IncSQL = GetSQL(ProjEA, ProjName, Phase, CountyCheck, RouteCheck, Begin, Ending)
  12.  
---------
Expand|Select|Wrap|Line Numbers
  1. Function GetSQL(ProjEA, ProjName, Phase, CountyCheck, RouteCheck, Begin, Ending As String) As String
  2.  
  3. If ProjEA = True And ProjName = True And Phase = True And CountyCheck = True And RouteCheck = True And Begin = True And Ending = True Then
  4.     IncSQL = "Proj.EA, Proj.ProjName, Proj.Phase, Postmiles.County, Postmiles.Route, Postmiles.Start, Postmiles.End"
  5. .
  6. .
  7. .
  8. Else
  9. MsgBox "Please Select at least one Output", , Error
  10.  
  11. End If
  12.  
  13.  
  14. End Function
  15.  
Nov 20 '07 #2
Got it working!

The code needed to be in the Module portion not the Class portion
Nov 20 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Steven | last post by:
I'm writing a Python script which can be called from the command-line, and I want to use my module doc string as the CL help text, but I don't know how to access my module object from inside the...
1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
6
by: Sean Berry | last post by:
I don't know that this partilarily bad programming, but I was interested in doing the following. def functionname( module, var1, var2 ): import module I would like to be able to pass the...
3
by: sean | last post by:
In article <cyH8c.3460$GH3.601@fed1read07>, sean@sands.beach.net (Sean Berry) writes: > I don't know that this partilarily bad programming, > but I was interested in doing the following. > > def...
3
by: Rob McCrea | last post by:
Hi all, On windows98SE, running Python 2.3.4 (#53, May 25 2004, 21:17:02) on win32, the built-in help() function gives me a deprecation warning when used on my docstrings. just help() start...
4
by: Lonnie Princehouse | last post by:
I've run into some eccentric behavior... It appears that one of my modules is being cut off at exactly 2^14 characters when I try to import it. Has anyone else encountered this? I can't find any...
2
by: rh0dium | last post by:
Hi all, So I have a slice of code which calls other python code. I have started to take a real liking to the logging module, but I want to extend this into the called python code. I have no...
1
by: alain MONTMORY | last post by:
Hello everybody, I am a newbie to python so I hope I am at the right place to expose my problem..... :-http://www.python.org/doc/2.4.2/ext/pure-embedding.html 5.3 Pure Embedding I download the...
6
by: JonathanOrlev | last post by:
Hello everyone, I have a newbe question: In Access (2003) VBA, what is the difference between a Module and a Class Module in the VBA development environment? If I remember correctly, new...
0
by: Lie | last post by:
Yesterday I installed compiz-icon in my Ubuntu. Today, when I go to the python interpreter, I happen to do this: ### START OF PYTHON SESSION ### Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.