By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

Industrial Database Access

P: 58
I use MSAccess a lot, but rarely VB code within it.

I need to:
Run a set of reports for customer, output to html (saved in the file folder which is named after the customer number), run reports for second customer, output to html, etc. until this has been done for every record in the customer table.

I also need to ftp each of the reports to web server.

Can this be done all in one click?

File structure on web:
Equipment Report
Inspection Report
Announcements Report
Employee Training Report
Equipment Report
Inspection Report
Announcements Report
Employee Training Report

Nov 15 '06 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 3,072
This wil require a recordset processing loop like:

' Use Tools/References to check the "Microsoft DAO #.##" library
Dim rs as DAO.recordset

' Assign the table to the recordset
set rs = currentdb.openrecordset("YourTableName")

' Test for empty table (just to be sure :-)
if rs.eof and rs.bof then
msgbox "No data"
exit sub

' here we have records and need to loop till the end:
WHILE not rs.eof
' here do the processing e.g. writing to a file with the PRINT statement
' referring to recordset fields is like: rs!fieldname
' read next row

Finally we'll have to make a file in HTML format, but I gavethis code s you have a basic start. For the HTML we can embed the needed tags and save the file is a folder indicated on your form or e.g. in another table.
How's that in your design ?

Nov 16 '06 #2

Expert 100+
P: 1,418
For the file creation you can use those commands

Open "Myfile.html" for Output as #1
Print #1, "<<OPEN TAG CLOSE TAG>>"
Close #1
Nov 18 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.