cowspotter
New member
- Local time
- Today, 17:48
- Joined
- Aug 13, 2008
- Messages
- 8
I need some help with a query that I'm trying to run on an Access 2007 database. I have a query that returns a list of records (date, user, index number, platform, etc) and that query works fine. My issue is that I want the user to be able to use a form to select either a specific platform or all platforms.
The query is stored already as Last_Update. Here is the SQL:
SELECT Cases.CaseNumber, Cases.CaseSeverity, Cases.CaseEscalation, Cases.CaseOpenDate, Max(CasesAuditRecords.CaseAuditRecordTimeStamp) AS [Last Updated]
FROM Cases INNER JOIN CasesAuditRecords ON Cases.CaseNumber = CasesAuditRecords.CaseNumber
WHERE (((Cases.CaseStatus)="Open"))
GROUP BY Cases.CaseNumber, Cases.CaseSeverity, Cases.CaseEscalation, Cases.CaseOpenDate;
As you can see, there is no platform reference. In its current form it returns data for all platforms. I've been trying to figure out a way to either modify this query in VBA or to just delete it and replace the query with the platform needed specified in the SQL.
I found code (i think through google on this site) that is supposed to modify a query but I can't get it to run and I have a feeling its because I have 2007. I know how to delete the query, but I can't create a new query via VBA.
The reason I'm going about it this way is because my users use Access runtime and they want to be able to sort the data so a report wouldn't work. I need the query to execute and display in the normal query results viewer (datasheet view). Any ideas? Sorry if I'm missing some important details here. Just ask and I'll try to explain something further.
The query is stored already as Last_Update. Here is the SQL:
SELECT Cases.CaseNumber, Cases.CaseSeverity, Cases.CaseEscalation, Cases.CaseOpenDate, Max(CasesAuditRecords.CaseAuditRecordTimeStamp) AS [Last Updated]
FROM Cases INNER JOIN CasesAuditRecords ON Cases.CaseNumber = CasesAuditRecords.CaseNumber
WHERE (((Cases.CaseStatus)="Open"))
GROUP BY Cases.CaseNumber, Cases.CaseSeverity, Cases.CaseEscalation, Cases.CaseOpenDate;
As you can see, there is no platform reference. In its current form it returns data for all platforms. I've been trying to figure out a way to either modify this query in VBA or to just delete it and replace the query with the platform needed specified in the SQL.
I found code (i think through google on this site) that is supposed to modify a query but I can't get it to run and I have a feeling its because I have 2007. I know how to delete the query, but I can't create a new query via VBA.
The reason I'm going about it this way is because my users use Access runtime and they want to be able to sort the data so a report wouldn't work. I need the query to execute and display in the normal query results viewer (datasheet view). Any ideas? Sorry if I'm missing some important details here. Just ask and I'll try to explain something further.