I want to run a SELECT command in VBA.
I had a quick research and I see you have to run a query.
I have a query now that produces the desired result.
I have a few questions,
1. how do i pass a parameter to the query.
2. how do I Stop the query from producing the datasgeet view (I don't want the user to see it but to get data from it to be used in the VBA code and onto a form).
3. How do I get the values of the field into my VBA code.
Incidentally the query should only produce 1 row if I can pass over a parameter to it (to be used in the where statement).
The sql from the query is
SELECT [Component SWAPS].JobPartID, Last([Component SWAPS].ModelNumber) AS LastOfModelNumber
FROM [Component SWAPS]
GROUP BY [Component SWAPS].JobPartID;
I want to pass to it a value for [Component SWAPS].JobPartID within VBA.
I then want to pick up the value of LastOfModelNumber
.
I had a quick research and I see you have to run a query.
I have a query now that produces the desired result.
I have a few questions,
1. how do i pass a parameter to the query.
2. how do I Stop the query from producing the datasgeet view (I don't want the user to see it but to get data from it to be used in the VBA code and onto a form).
3. How do I get the values of the field into my VBA code.
Incidentally the query should only produce 1 row if I can pass over a parameter to it (to be used in the where statement).
The sql from the query is
SELECT [Component SWAPS].JobPartID, Last([Component SWAPS].ModelNumber) AS LastOfModelNumber
FROM [Component SWAPS]
GROUP BY [Component SWAPS].JobPartID;
I want to pass to it a value for [Component SWAPS].JobPartID within VBA.
I then want to pick up the value of LastOfModelNumber
.