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

Dynamic Field passed via Form Variable??

Status
Not open for further replies.

safaritek

Programmer
Feb 13, 2003
79
CA
In order to avoid a ton of work, I need to be able to pass the field that is to be queried via a form field.

The database is a compilation of Engineering data, and one of the tables holds formulas used in calculating different factors.

Table = "Formulas"
Column Queried = *chosen field*

Form Field = [Forms]![Builder]![VARIABLEID]

Normally I would write a query in the SQL window that looks like this:

SELECT DISTINCT Vn
FROM Formulas

What I need to be able to do is this:

SELECT DISTINCT [Forms]![Builder]![VARIABLEID]
FROM Formulas

But alas, that does not appear to work ... it doesn't throw an error, but it does return nothing when I know there should be some set of results.

Any ideas??

 
Hi,

Have you tried:
Code:
SELECT DISTINCT [Forms]![Builder]![VARIABLEID].Value
FROM Formulas?
To refer to the value dsplayed in the 'control'.

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience." darrylles@totalise.co.uk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top