SQL-to-HTML for MS Access โ SQL as an Interactive Table, with a Safe Preview
Turn any SQL statement into a clean, interactive HTML table โ and preview action queries before they change a single record. One line of code, and the result appears in your browser, inside an Access form, as an HTML file or as a string.
Every Access developer knows the moment: you write a DELETE or UPDATE query, press Runโฆ and hold your breath. Did it hit the right rows? The datasheet is cramped, action queries tell you nothing before they strike, and turning a result into a readable report means copy, paste and fiddling. The SQL-to-HTML Tool solves all of that with a single line:
ShowAsHtml "SELECT * FROM tblCustomers", "My customers" Instantly you get a modern, styled, sortable table.
The highlight: a safe preview for action queries
The tool does far more than display a SELECT. For every action query it builds a preview of what would happen โ without touching your data:
- ๐ด DELETE / DROP โ a red warning box shows exactly which records or objects would be removed.
- ๐ก UPDATE / ALTER โ the new values appear as extra columns, right next to the current data.
- ๐ต INSERT / APPEND / MAKE TABLE โ you see the rows that would be added or written.
See before you change. No more guessing, no more โoopsโ.
What the HTML table gives you
- Sortable columns โ click a header; sorting is type-aware for numbers, currency, dates and text.
- Live search/filter field to find any value instantly.
- Sticky header that stays visible while you scroll.
- Row & column highlighting on hover.
- Zebra striping and automatic formatting of dates, currency and numbers.
- Live record counter โ always know how many rows you are looking at.
- Clean, modern, responsive design.
Four ways to output โ one parameter
- ๐ Browser โ open the result in the default web browser.
- ๐ฅ๏ธ Access form โ display it directly inside your application (Edge control).
- ๐ HTML file โ save a self-contained, UTF-8 encoded file to share or archive.
- ๐ข HTML string โ return the markup for e-mails, reports or further processing.
Built for real-world Access
- Runs on 32-bit and 64-bit, Microsoft 365 and Access 2021 or newer.
- Late binding โ drop in one module, no reference juggling.
- HTML-injection safe โ your data can never break the layout.
- Robust SQL parser โ copes with quotes, commas inside values and bracketed field names.
- Built-in error logging for painless troubleshooting.
A typical use case
Before you run a bulk UPDATE on a live table, you call ShowAsHtml with the statement. The tool shows a warning banner and a table containing the current data plus the new values as additional columns. You check it, close it, and only then execute the query โ with confidence instead of a held breath. Or simply hand a colleague a single HTML file of a query result that opens in any browser โ no Access required.
Youโll find the detailed description directly in the code, well documented as usual.
Download
A VBA tool for MS Access that turns SQL into a sortable, searchable HTML table โ with a safe preview for DELETE/UPDATE/INSERT, four output options, late binding and HTML-injection safety.




