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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query optimization 1

Status
Not open for further replies.

ktighe

Programmer
May 25, 2001
45
0
0
US
I have a query that calls some vb module functions to do a lot of string manipulation. The problem is, my query calls the functions several times for each record to get back the exact same data. Is there a way that I can call the function once, then store the result in a temp variable for each record? Calling the functions over and over is obviously slow, especially when the query is run against a large amount of data. I know that I could just design several queries to accomplish the same result, but I was wondering if there was an easier way....
Thanks in advance for any help!

Kevin
 
Yes but you still have to have another funciton to get a t the Global varaiable

1st Open a module and add this line near the

Global yourVariableName

then in your Function before it exits put this

yourVariableName = whatever you are doing

then in the query call a new function such as
Like so =TempVariable()

Function TempVariable()
TempVariable = yourVariableName
End Function

See you can't get a Variable directly in a query but if you pass a global variable to another function then that function can equal the global variable
And call that function in your query



DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top