Home  Fees/Services  Access Examples  Tutorials  Access Download  Articles  Search  Contact  Privacy  Links

Access Form Programming Tutorial
Query Website Data

Form Subtotal Fields
Master/Detail Forms
NotInList Event
Speed Up Forms
Unbound Form
Change Textbox Height
Get Website Data
Access Audit Trail

Form Query Parameter

Get Data From Website to Access Form

Insert Data Into Access Database From HTML Page

Since 2000 we have developed nearly 500 databases for clients throughout the world. See a sample of them at our recent clients page.

Do you and your clients need access to data on the Internet? We can create a secure system to match your requirements perfectly.

Internet API:  It is sometimes useful to be able to send a request out to a website to retrieve live and timely data.  Stock quotes are a good example for this functionality.

Here we have a demo which retrieves data from Yahoo Finance website and display the data on an Access form.  You can use the same code to bring timely data to a report or within a query.

Here is an image of the objects involved:

stock quote api access form example

The table is simply a list of stock symbols:

Here is the function which does all the work:

Public Function quote(strticker As String)

Dim strurl As String, strcsv As String, strRows() As String, strColumns() As String

strurl = "http://download.finance.yahoo.com/d/quotes.csv?s=" & strticker & "&f=l1&ignore=.csv"

Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "GET", strurl, False
strcsv = http.responsetext

quote = Nz(CCur(strcsv), 0)
Set http = Nothing
End Function

This is a screen shot of the form in design view:

query website data from Access form

Note that the Stock Quote field passes the Stock_Symbol to a visual basic function.  The function returns the current value of the stock quote.  As you type in new symbols on the form the current price will be retrieved.  You can use the 'Refresh All' menu choice at the top of the form to get a fresh quote.

Feel free to download our Access database example for using a website API  to retrieve data into Microsoft Access.

And finally an image of the form running with all the stock symbols with current value.  Hopefully when I look at this in two years all the values will have doubled so that I can retire.

Get Data From HTML Page



A Blue Claw Software Design Template:

Airline Reservations Database Template

A Blue Claw Database Design Article:

Learn How To Select A Consultant

Microsoft Office Forms:
 MS Access 2003
 Access 2007
 Access 2010
 Access 2013

Contact Information

Copyright 2000-2018 Blue Claw Database Design