criteria in a search query

G

Guest

Hi

In a search query can I have the criteria set to a global variable in a
module and if so what is the correct syntax to use

Thanks in advance
bbdobuddy
 
G

Guest

One way to do this is to write some sort of getValue function then use that
getValue function in the SQL statement.

The code in the module would be something like this

Public Function getValue() as String 'Or whatever data type is correct for you
getValue = GlobalVariableName
End Function

The SQL would be something like

SELECT * FROM some_table WHERE
criteria_field = (setValue())

HTH!
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You have to use a function to retrieve the variable value. E.g.:

The function:
Public Function myVariable()
myVariable = g_strVariableName
End Function

The query:
SELECT *
FROM table_name
WHERE column = myVariable()

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQkCKpIechKqOuFEgEQL6CACbB7WGJbNkjCfrN630Idud82ZI0i4AnRKD
vZ9YEJl9UIqM7uYBPfT7KgAq
=W2MO
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top