Mendip Data Systems

Database applications for businesses and schools

LogoTransparent

LIVE Currency Exchange HTML Ticker

Version 1.1      Updated 18/10/2018               Approx 0.6 MB

 

This was created as a response to a question by forum member Gismo at Access World Forums

He wanted code to display live Forex (currency exchange) rates in a ticker tape format on an Access form.

 

I suggested 4 possible approaches:

1.  Use scrolling marquee text – see my Attention Seeking example app.

    As for the data, you would need to find a site which gives an XML or JSON output.

    This would then need to be imported and parsed to update the display at set intervals of your choice. Potentially complex to do.

 

2.  Use an ActiveX web browser control linked to a site containing this code as an HTML snippet. This has the advantage of being updated automatically.

 

3.   Add a currency exchange ticker widget to your own website using freely available code online. You would then use your webpage in the web browser control.

 

4.   Use my Currency Exchange Rate Tracker app as an alternative approach                                            

CERT Version 1.43

Example Apps for Businesses, Schools & Personal Use

Return to Example Databases Page

Click to download:   Currency Ticker LIVE v1.1     (zipped)

This example uses the idea outlined in point 3 above.

 

There are a number of websites offering free HTML widget code for currency exchange rates. First of all I tried the forexrealtime.com site but the HTML script suppled didn’t work for me. However, various HTML scripts available from exchangerates.org.uk worked perfectly. That ticker is more customisable in terms of width, speed & colours. It also indicates up/down trends. For example:                                                        

The Exchange Rates site also has other types of live currency widget scripts including a working forex example - but I prefer this one.

The HTML script used in the  widget is:

<iframe src="//www.exchangerates.org.uk/widget/ER-LRTICKER.php?w=600&s=2&mc=GBP&mbg=F0F0F0&bs=yes&bc =000044&f=verdana&fs=10px&fc=000044&lc=000044&lhc= FE9A00&vc=FE9A00&vcu=008000&vcd=FF0000&" width="600" height="30" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe>

Next I decided to make a working application based on this.

 

The app references another page on this website where I've removed all other menu items to keep things simple.

The full web address for that page is: http://www.mendipdatasystems.co.uk/live-currency-rates/4594448258

 

The web page includes this live currency rates chart as well as the ticker. The base currency can be updated using the dropdown box:

<link rel="stylesheet" type="text/css" href="//www.exchangerates.org.uk/widget/ER-SCRT2-css.php?w=180&nb=10&bdrc=e0e0e0&mbg=ffffff&fc=333333&tc=333333" media="screen" />

<div id="erscrt2"><div id="erscrt2-widget"></div><div id="erscrt2-infolink"><a rel="nofollow" href="//www.exchangerates.org.uk/British-Pound-GBP-currency-table.html" target="_new" ><img src='https://www.exchangerates.org.uk/widget/logo-333333.png' alt='ExchangeRates.org.uk'></a></div>

<script type="text/javascript">

var tz = 'userset';

var w = '180';

var mc = 'GBP';

var nb = '10';

var c1 = 'USD';

var c2 = 'EUR';

var c3 = 'AUD';

var c4 = 'JPY';

var c5 = 'INR';

var c6 = 'CAD';

var c7 = 'ZAR';

var c8 = 'NZD';

var c9 = 'SGD';

var c10 = 'CNY';

var t = 'Live Exchange Rates';

var tc = '333333';

var bdrc = 'e0e0e0';

var mbg = 'ffffff';

var fc = '333333';

 

var ccHost = (("https:" == document.location.protocol) ? "https://www." : "http://www.");

document.write(unescape("%3Cscript src='" + ccHost + "exchangerates.org.uk/widget/ER-SCRT2-1.php' type='text/javascript'%3E%3C/script%3E"));

</script>

</div>

The HTML code used in this widget is:

A thumbnail screenshot of the application is shown below. Click the screenshot to view a larger version

CurrencyRatesLIVE

At first I kept getting script errors at startup. To fix that, I had to add a cookie control on the specified webpage.

Click to accept & it will disappear in the usual way.

 

NOTE: If you still get a script error (possibly two) just click Yes twice

 

The same principle can be used with other live HTML scripts e.g. share prices / sports results / news updates.

If you can find a suitable script just adapt the widget on the website.

 

It would be even better to be able to load the HTML script & run it direct in Access without referencing a web page. I haven't looked into this as yet

For an alternative approach, see the Currency Exchange Rate Tracker application