PDA

View Full Version : Data exchange with a query



mud2
03-31-2005, 10:11 AM
How (can) I
1. Use a user-written function as part of the criteria in a select query? I.E,
The function might return the value of a variable.

2. Obtain the data from such a query...or at least finding out if the query found a matching field...without viewing the query

I hack around this by using a FORM based on the query. I can test a field in the form for NULL or "". But Cannot use a variable in the query's criterion field.

SJ McAbney
04-01-2005, 01:46 AM
1. Just use the function in the query as you would any other criteria

SELECT *
FROM MyTable
WHERE MyField = MyFunction();

2. You could use the DLookup() domain aggregate function or, if you are into code, use either a DAO or ADO solution to open the recordset and get the value of whatever field you want.