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

You did not know that nearly 100 cable and satellite tv installers use our software to manage their device inventory. They never lose track of an expensive device.

We have expert enterprise-level database development capabilities for cloud/web-based databases through our partnership with IT Impact.

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:

Barcode-Device Inventory Database

A Blue Claw Database Design Article:

Repair Corrupted Access Table

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

Contact Information

Copyright 2000-2017 Blue Claw Database Design