Access to Html

rbsmit02

Board Regular
Joined
Jun 18, 2004
Messages
142
Quick question
I know that in excel u can use VB script to export custom html documents.

Is this possible in Access and would the VB be basically the same?

Ex.
Code:
Open PageName For Output As #1
Print #1, "<html>"
Close #1

I am just starting with access so I dont have any databases to test this on and its for a future project anyway.

-Thanks! (y)
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I'm not sure what you mean by custom HTML but in Access 97 there is an option on the File manu to Save as HTML.

When chosen it starts up a wizard.

Also there is the option from the Send... to send as HTML.

You'll probably be able to do both these actions using VBA.
 
Upvote 0
when you save as html it just saves the workbook as html and you view it like it is an excel documnet.

now in vb you can make a macro to print out the html page exactly how you want it to look and grab the values from cells and print it out to the custom page.

Like so:
Code:
sub makehtml()
Open test.htm For Output As #1 
Print #1, "<html>" 
Print #1, "<body bgcolor=blue>"
Print #1, "the value is <font color=white>" & sheets("test").Range("A1").text & _
 "</font>."
Close #1 
End sub

I guess what i'm asking is there something comperable to this in access.

instead of refrencing a cell i need to know how to refrence a spot in a database to pull the data from.

It might not be possible i just dont know enough about access to figure it out.
 
Upvote 0
Well you could use the Recordset object

Recordsets can be SQL statements, tables, queries etc

You can cycle through all the records in a recordset and get access to the fields of the records. So I suppose you could create an HTML that way.

Check one of my other posts today which has an example of using recordsets.
 
Upvote 0

Forum statistics

Threads
1,221,827
Messages
6,162,202
Members
451,752
Latest member
freddocp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top