E
egun
I have this line in a VBA module:
DoCmd.ApplyFilter Get_WBS_String_Query
which is supposed to filter all the records in my database by the WBS field.
The user clicks on one of several checkboxes on the main form to select
which WBS to filter, and then the VBA code is run to filter the records.
The "Get_WBS_String_Query" is a query whose SQL looks like this:
SELECT tlkpWBS.WBS, [MyParam] AS Expr1
FROM DATATABLE INNER JOIN tlkpWBS ON DATATABLE.[Primary WBS] = tlkpWBS.ID
WHERE (((tlkpWBS.WBS) Like [MyParam]));
When I run the query manually, it requests the parameter, and I enter
something like "11*", and it will correctly filter WBS for all items starting
with "11". I need to be able to supply the query parameter in the VBA code,
but don't know how.
Is this a good way to do this? Any better ideas? Some of the queries are
complex (such as wanting to include all items starting with "1", but
excluding "14*" and "16*").
Thanks in advance,
Eric
DoCmd.ApplyFilter Get_WBS_String_Query
which is supposed to filter all the records in my database by the WBS field.
The user clicks on one of several checkboxes on the main form to select
which WBS to filter, and then the VBA code is run to filter the records.
The "Get_WBS_String_Query" is a query whose SQL looks like this:
SELECT tlkpWBS.WBS, [MyParam] AS Expr1
FROM DATATABLE INNER JOIN tlkpWBS ON DATATABLE.[Primary WBS] = tlkpWBS.ID
WHERE (((tlkpWBS.WBS) Like [MyParam]));
When I run the query manually, it requests the parameter, and I enter
something like "11*", and it will correctly filter WBS for all items starting
with "11". I need to be able to supply the query parameter in the VBA code,
but don't know how.
Is this a good way to do this? Any better ideas? Some of the queries are
complex (such as wanting to include all items starting with "1", but
excluding "14*" and "16*").
Thanks in advance,
Eric