Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2003, 10:07 AM
Authorized User
Join Date: Jun 2003
Location: Birmingham, N/a, USA.
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default Macro

Dear Sir,

I am trying to create HTML pAges from a single Query. How would I create a macro to return One single record, to a text file(or HTML file). There are 32 records in my Query result!!!

Or can I write some code behind a form to create several different .txt or .html pages?

I would like to auto produce HTML pages, due to the information being held in the database, but my web information being in a different place. Thus not writting in the same information every month, just using the macro to populate the pages.

Than you
Reply With Quote
  #2 (permalink)  
Old June 13th, 2003, 12:00 AM
Friend of Wrox
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts

Well, it all depends on a LOT of different things how you'd go about putting this into place.
Say for example you have some stuff at the top of the page and the bottom that remains constant, and it's only the numbers you change, well, depending on your server setup, you could use Server Side Includes to have a page call 3 different pages - the top, the bottom, and the middle.


You could export a report as HTML


You could create HTML by writing the actual HTML to a text file

Basically - there's heaps of ways to do it.

However, if you have 32 records in your query, and therefore want to create 32 different files, each with just one row of data, I'd suggest opening the query as a recordset and creating the HTML like I mentioned in the 3rd seggestion.

I'm not going to write the code here for you, just a bit of crappy pseudocode to give you an idea of what I'm on about
Initialise counter to 1
Open recordset
While not recordset.EOF
Open "ExportFile" & Counter & ".html"
   Write Header HTML tags
   Write data
   Write Ending HTML tags
Close ExportFile
Counter = Counter+1
Next record

However, as I mentioned - exactly how you implement it will be based on heaps of things - such as - Server setup, your VBA skills, how you want it saved, whether or not you can save it directly to the Web Server.

But - if you just want the first record of the query - you could always just have the query being
and export that query as HTML

Hope this points you in a more specific direction


There are 10 kinds of people in the world - those who understand binary - and those with friends
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
calling to xlam macro from macro inside xlsb SteveB Excel VBA 0 June 30th, 2008 06:43 PM
Need Help For A Macro Code vicky.dalmia Excel VBA 1 December 16th, 2005 07:37 AM
TransferDatabase Macro jmss66 Access 13 January 21st, 2005 11:22 AM
Macro Doesn't Run? CoryKutchera Excel VBA 3 January 5th, 2005 10:30 AM
Macro Help! Jolin VB How-To 0 April 22nd, 2004 08:38 AM

All times are GMT -4. The time now is 06:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.