Is this possible?

Velosai

Registered Headache Cause
Local time
Today, 00:18
Joined
Aug 3, 2007
Messages
38
I'm trying to create a filtering system for a customer of mine, based upon a series of SQL strings. I've created a table with all the SQL, etc in, but part of the problem is that I have variables amongst some of the SQL statements. I can pre-define the variables along side the SQL in the table (come up with a method of storing them as a single string then separating them out into 2 arrays (one of var names, the other the type), but now I am stuck. Is it possible to use those arrays and their values as individual variables?

I know you can create new forms, build new forms from data contained with in tables (I've done it and it gives me a headache everytime I do), but is there a way of creating variables on the fly? Pllllllease say there is and it is nice and simple.

Regards

Velosai
 
I would recommend you always use queries as the datasource for forms and reports rather than directly from tables. Its easy to adda new fieldto a query and you can include calculated fields without problem.

You can extract info from an array like this


field = array(index). Remember array indexes in Access start from 0 not 1
 
Thanks

Thanks for that Rabbie, unfortunately, this is one of the few occasions I am not using a query. Mainly because I am only reading from the data through DAO from VBA.

My problem is changing an array into a set of variables, if I can do that I will be well away and extremely happy. The array currently holds Var name and Var type (ie strName and String). So if I can change that so it acts like "Dim strName as String" .... well, would be greatly indebted
 
if you truly want to pursue it in this manner, your best bet would be using the module object. Look up the methods in the help file, they're pretty straight forward...you'll be using a combination of DeleteLines, AddFromString, and Insert, I'll wager.
 
Thanks Bodisathva. So effectively I would be creating a module on the fly each time ..... Ok, gonna need to go have a read and play. Thanks for pointing me in the right direction
 

Users who are viewing this thread

Back
Top Bottom