none
Format says British £ but Form shows Swedish currency "kr" RRS feed

  • Question

  • Hi

    I have an App were currency format can be changed. It works normally but not in this case. I have an Order Form were the user picks Products from the ProductTable using a Combo box. The Product is bound to an uniqe ArticleNumber. With every ArticleNumber goes a RetailPrice and a WholesalePrice.

    If I add or change the Product the RetailPrice and WholesalePrice connected to each Product show in separate colums on a form.

    I use an OnLoad event to give the pricecontroles the current currency.
    The event works. Format get its right "value" but does not change the currency symbol, Why? Please help.

    See image below.


    Cheers // Peter Forss Stockholm

    Monday, September 9, 2019 8:52 PM

Answers

  • I'd change the setup.

    • Add the 'SB artiklar' table to the 'Ordersidan rader i ordern' query. Access will automatically join them on 'SB artikelnummer'.
    • Add the 'Rek pris ut' and 'Rek pris ut Grossist' fields from the 'SB artiklar' table to the query grid.
    • Save the query.
    • Open the 'Order rader' form in design view.
    • Change the Wholesale and Retail combo boxes to text boxes.
    • Set their Control Source to the 'Rek pris ut Grossist' and 'Rek pris ut' fields.
    • Set the number format in the On Load event of the form. It'll work as intended.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by ForssPeterNova Tuesday, September 10, 2019 12:57 PM
    Tuesday, September 10, 2019 12:22 PM

All replies

  • Testing this, while it seems to work when using the form's Load event procedure, to change a property of a control there is no need to wait for the form's recordset to load, so in a case like this I would use the form's Open event procedure.  Try that.  It might not make any difference, as the cause of the problem my lie elsewhere, but it's worth a try.

    Ken Sheridan, Stafford, England

    Monday, September 9, 2019 9:15 PM
  • Hi Ken

    I changed event to Open. But still "kr" instead of £, although the "content" of the Format property still is "£ "# ##0,00;"£ -"# ##0,00[Red];0;"Not defined"[Red]

    So it must be something else.


    Cheers // Peter Forss Stockholm

    Tuesday, September 10, 2019 4:22 AM
  • I am not so sure if i "got" your problem...but you are trying to change the currency symbol on the fly from Swedish Kr to British pound and while everything seems right this doesn't kick in ?

    At first check if the Format actually is working...just use the "On Got Focus" to ensure that the format  has changed and report back...

    Tuesday, September 10, 2019 5:41 AM
  • Hi

    The BE table has Data Type Currency. When No Format is choosen in the table, Access use my computers currency settings (I am a Swedish).

    If I, in the table settings use Format "£ "# ##0,00;"£ -"# ##0,00[Red];0;"Not defined"[Red] then my Access Form show the pound sign. Even if I, in the Forms Format write Euro.


    Cheers // Peter Forss Stockholm

    Tuesday, September 10, 2019 5:53 AM
  • Hi John

    1:

    I manually edit the Format in Form to nothing. Saves the changes.

    When open the Form again the Format is there: "£ "# ##0,00;"£ -"# ##0,00[Red];0;"Not defined"[Red]

    But still Swedish kr is displayed.

    2: I manually edit the Format in the Form to Euro. Save the changes.

    When open the Forms again the Format is there: "£ "# ##0,00;"£ -"# ##0,00[Red];0;"Not defined"[Red]

    But still Swedish kr is displayed.

    Were do you want me to use On Got Focus?

    3:

    I manually change Format to Euro in Layout view. Save changes. Goes back to Form view. Still Swedish kr is displayed. Goes back to Layout view again, The Format is still Euro.

    4:

    On the same Form there is a Qty Field. If I set the Format to "£ "# ##0,00;"£ -"# ##0,00[Red];0;"Not defined"[Red] the Pound sign is displayed. 
    So it works on the Form, but not on the Forms Combo Boxes (Retail price and Wholesale price)


    Cheers // Peter Forss Stockholm



    Tuesday, September 10, 2019 6:10 AM
  • I meant on the combobox where you see the price.

    Probably the best assistance would be provided by uploading a sample application... 

    Tuesday, September 10, 2019 6:38 AM
  • Will upload a sample. Later this day. Now strictly beer matters.

    Cheers // Peter Forss Stockholm

    Tuesday, September 10, 2019 6:40 AM
  • Now strictly beer matters.

    Hi Peter,

    Last weekend I was in Interlaken (CH), and I had also those moments.

    As the RetailPrice and WholesalePrice are filled by code, a couple of "normal" events are not fired, e.g the AfterUpdate event. I can imagine that the AfterUpdate events sets the proper format of the values. Perhaps you can run the AfterUpdate events of the RetailPrice and WholesalePrice in the Load (or Open) event after assigning the value.

    I am not sure if this works, I never tried it. In all my "financial" overviews I never use any Access setting, but deliver the complete formatted string including the right currency symbol. So completely independent of any regional setting.

    Imb.

    Tuesday, September 10, 2019 8:26 AM
  • Hi Imb

    I tried After Update. It did not change the fact "kr" is displayed although Format says something else.


    Cheers // Peter Forss Stockholm

    Tuesday, September 10, 2019 11:25 AM
  • Hi all

    Here is a link to a stripped database.

    https://1drv.ms/u/s!AtSr8PNw-1ZFgbVvXV1SPdepm9vZDQ?e=s05d9r


    Cheers // Peter Forss Stockholm

    Tuesday, September 10, 2019 11:26 AM
  • I'd change the setup.

    • Add the 'SB artiklar' table to the 'Ordersidan rader i ordern' query. Access will automatically join them on 'SB artikelnummer'.
    • Add the 'Rek pris ut' and 'Rek pris ut Grossist' fields from the 'SB artiklar' table to the query grid.
    • Save the query.
    • Open the 'Order rader' form in design view.
    • Change the Wholesale and Retail combo boxes to text boxes.
    • Set their Control Source to the 'Rek pris ut Grossist' and 'Rek pris ut' fields.
    • Set the number format in the On Load event of the form. It'll work as intended.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    • Marked as answer by ForssPeterNova Tuesday, September 10, 2019 12:57 PM
    Tuesday, September 10, 2019 12:22 PM
  • Thanks Hans!

    Perfect.


    Cheers // Peter Forss Stockholm

    Tuesday, September 10, 2019 12:58 PM