How do you add a field to an existing query using vba? Using MS Access module
I need to add/append a table field to an existing select query and save the query using vba code.
1. I will specify the name of the field to be added
2. I need to specify the table it is added from
3. I need to specify in the totals row that it is "SUM"
4. I also need to specify the caption for the newly added field
Then I will save the query
This query is tricky because I am using the "SUM" totals for most of my existing query fields except for 2.
I have been trying to figure this out for a day and a half and I am getting nowhere, ANY help would be appreciated.
I cannot even figure out the code to alter the query.
I need to add/append a table field to an existing select query and save the query using vba code.
1. I will specify the name of the field to be added
2. I need to specify the table it is added from
3. I need to specify in the totals row that it is "SUM"
4. I also need to specify the caption for the newly added field
Then I will save the query
This query is tricky because I am using the "SUM" totals for most of my existing query fields except for 2.
I have been trying to figure this out for a day and a half and I am getting nowhere, ANY help would be appreciated.
I cannot even figure out the code to alter the query.