Results 1 to 9 of 9
  1. #1
    Thomasso is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Czech Republic
    Posts
    250

    Question Automatically import market data such as VAT and currency rates

    Hello,



    my company does international operations and we use currency rates on a daily basis. I would like to automatically feed the database the actual rates for today from a http source. I would like to keep VAT percentage rate as well, maybe even other values.

    I would then like to work with the numbers. For example, I have a price list from my suppliers in USD, but I want to display the today's product value in my currency, using the rate from the http. And I want to be able to manually edit the VAT, if it changes.


    What would be the best solution for this? I thought of a table, something like tbl_MarketData. But I ran into some problems. I set the VAT format to percentage, but no matter what number I insert, it stays at 0 %. With the currency rate fields, I am unable to display decimal points, even though I have set it to 2 figures. Also, what is the best way to import current data? Or is my approach totally wrong? Is there a better way to deal with this?

    Thank you for every insight.

    Cheers.
    Tomas

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Sounds like you have an integer number datatype. Change it to Single.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Thomasso is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Czech Republic
    Posts
    250
    I tried that but unfortunately it did not help.

  4. #4
    dniezby is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Apr 2013
    Posts
    183
    Ooo. I did something like this a while back.

    If memory serves, you don’t need a table to hold that meeker data at all. You need a blank field with a name, a script to qwerry the web for the result and a button.

    I don’t remember the exact code so hopefully this train of thought will guide you.

    So, saying the boxes name is “mrkt-current” then on the action of the button set on_press mrkt_current = qwerry the web

    See where I’m going? That way you have the freshest result and it’s a live result.

    Hope this helps.


    Sent from my iPhone using Tapatalk

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    For part of this you may be able to use my Currency Exchange Rate Tracker app http://www.mendipdatasystems.co.uk/cert/4594365453.

    Sorry but I can't tell from your description what the issue is with decimal points
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    Thomasso is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Czech Republic
    Posts
    250
    Quote Originally Posted by isladogs View Post
    For part of this you may be able to use my Currency Exchange Rate Tracker app http://www.mendipdatasystems.co.uk/cert/4594365453.

    Sorry but I can't tell from your description what the issue is with decimal points
    Thank you for the tip, I will check that app out.

    It is quite hard for me to describe the issue because I don't use English version of MS Access and everything is named differently. Please see the attached screenshots.

    Click image for larger version. 

Name:	access1.PNG 
Views:	15 
Size:	9.3 KB 
ID:	37981
    This is the table design tab. The first field is the PK auto counter, then I have Date for the market data, "DPH" is "VAT" in my language, data type "Number", then I have the currency exchange rates.

    Click image for larger version. 

Name:	access2.PNG 
Views:	14 
Size:	7.0 KB 
ID:	37982
    This is the properties of one of the currency exchange rate. The first value is "decimal number" with 2 numbers after the decimal dot.

    Sorry, not sure how else to describe, it's always an issue to operate in a different language. :-)

  7. #7
    Thomasso is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Czech Republic
    Posts
    250
    Quote Originally Posted by dniezby View Post
    Ooo. I did something like this a while back.

    If memory serves, you don’t need a table to hold that meeker data at all. You need a blank field with a name, a script to qwerry the web for the result and a button.

    I don’t remember the exact code so hopefully this train of thought will guide you.

    So, saying the boxes name is “mrkt-current” then on the action of the button set on_press mrkt_current = qwerry the web

    See where I’m going? That way you have the freshest result and it’s a live result.

    Hope this helps.


    Sent from my iPhone using Tapatalk

    Thank very much for the advice, however I don't exactly understand it. What do you mean by "blank field"? Is it a field in a table? What kind of a script do you mean?

    Unfortunately you seem to be too advanced for me . Could you please try to explain it "stupidly"? Thanks!

  8. #8
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    In the exchange property meritko (scale) is the number of decimal places allowed. Set that to 2.

  9. #9
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Davegri is correct if you are using decimal numbers
    I'd go further and repeat my previous advice. Change the decimal datatype to Single.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 8
    Last Post: 07-07-2017, 04:53 PM
  2. Market Data Retrieval
    By Grefcon901 in forum Access
    Replies: 16
    Last Post: 04-07-2016, 01:59 PM
  3. Replies: 22
    Last Post: 12-20-2015, 02:46 AM
  4. Replies: 11
    Last Post: 07-20-2015, 06:07 PM
  5. Replies: 6
    Last Post: 03-11-2015, 08:39 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums