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.
2 1138
Here is my code -
Dim db As DAO.Database
-
Dim rs As DAO.Recordset
-
Dim qd As DAO.QueryDef
-
Dim rst As DAO.Recordset
-
Dim DateSQL, PostSQL, PDSQL1, PDSQL2, PDSQL3, PDSQL4, PDSQL5, PDSQL6, PDSQL As String
-
Dim FormSQL1, FormSQL2, FormSQL3, IncSQL As String
-
-
-
'ProjEA, ProjName, Phase, CountyCheck, RouteCheck, Begin, Ending
-
-
IncSQL = GetSQL(ProjEA, ProjName, Phase, CountyCheck, RouteCheck, Begin, Ending)
-
--------- -
Function GetSQL(ProjEA, ProjName, Phase, CountyCheck, RouteCheck, Begin, Ending As String) As String
-
-
If ProjEA = True And ProjName = True And Phase = True And CountyCheck = True And RouteCheck = True And Begin = True And Ending = True Then
-
IncSQL = "Proj.EA, Proj.ProjName, Proj.Phase, Postmiles.County, Postmiles.Route, Postmiles.Start, Postmiles.End"
-
.
-
.
-
.
-
Else
-
MsgBox "Please Select at least one Output", , Error
-
-
End If
-
-
-
End Function
-
Got it working!
The code needed to be in the Module portion not the Class portion
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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,...
|
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...
| |