none
Cannot get MessageBox message to include both text and numbers and/or dates in Access Web App RRS feed

  • Question

  • Hello, in Access Web App I have a number in a variable ([FX_rate]=1.2345678) and a date in a variable [BB_date] and would like to have a message box to say:

    The fx rate will be updated to 1.234, which is the closing Bloomberg rate of 16/03/15

    I cannot seem to have access to any of the format or cast functions in the macro builder to turn the numbers/dates into text.

    The message box works if I only use one variable as the only input, but this is not much use.

    Any suggestions are welcome.

    Thursday, March 3, 2016 10:30 AM

Answers

  • in Access Web App I have a number in a variable ([FX_rate]=1.2345678) and a date in a variable [BB_date] and would like to have a message box to say:

    The fx rate will be updated to 1.234, which is the closing Bloomberg rate of 16/03/15

    I cannot seem to have access to any of the format or cast functions in the macro builder to turn the numbers/dates into text.

    Hi,

    in macros you can use Concat(). So this should work as Message argument:

    =Concat("The fx rate will be updated to ",[FX_rate],", which is the closing Bloomberg rate of ",[BB_date])


    cu
    Karl
    Access FAQ (de/it): donkarl.com
    Access Lobby: AccessDevelopers.org


    • Edited by Karl DonaubauerMVP Friday, March 4, 2016 2:35 PM added a documentation link
    • Marked as answer by Gianburrasca Friday, March 4, 2016 2:52 PM
    Friday, March 4, 2016 2:31 PM

All replies

  • First I have to say you really should not be using MS Access to build web applications. It is completely unsuitable.

    However, if you can only specify one variable for your message box, is there not a way to concatenate your text and variables into a string, then specify that string in the Message box? If you cannot do a simple thing like this, I would be tempted to abandon this limited development technology and use a real web development tool. You need a development tool that has a real programming language behind it.

    Thursday, March 3, 2016 3:42 PM
  • >>>I cannot seem to have access to any of the format or cast functions in the macro builder to turn the numbers/dates into text.

    The message box works if I only use one variable as the only input, but this is not much use.<<<

    According to you description, I have reproduced this issue. Unfortunately, I did not see any workaround to overcome this, but I will still keep troubleshooting this issue. 

    I suggest that you could feel free to submit any feedbacks for Access to User Voice:

    https://access.uservoice.com/

    Thanks for your understanding.

    Friday, March 4, 2016 6:58 AM
  • I agree with you in principle but I am not actually a real programmer, just a user.  I find Access Web App really good for simple internal business applications which do not require any fancy graphics or user interaction.  And it integrates well with Excel, which we all use in the office.

    The problem is that the variable definition macro surface seems to have no access to the format or cast/try cast functions, so that you can concatenate text but not turn numbers/dates into text.  This is a limitation.

    If only they would develop Access Web App a little more, it would be really great for such internal applications and quick prototyping.

    Friday, March 4, 2016 1:56 PM
  • in Access Web App I have a number in a variable ([FX_rate]=1.2345678) and a date in a variable [BB_date] and would like to have a message box to say:

    The fx rate will be updated to 1.234, which is the closing Bloomberg rate of 16/03/15

    I cannot seem to have access to any of the format or cast functions in the macro builder to turn the numbers/dates into text.

    Hi,

    in macros you can use Concat(). So this should work as Message argument:

    =Concat("The fx rate will be updated to ",[FX_rate],", which is the closing Bloomberg rate of ",[BB_date])


    cu
    Karl
    Access FAQ (de/it): donkarl.com
    Access Lobby: AccessDevelopers.org


    • Edited by Karl DonaubauerMVP Friday, March 4, 2016 2:35 PM added a documentation link
    • Marked as answer by Gianburrasca Friday, March 4, 2016 2:52 PM
    Friday, March 4, 2016 2:31 PM
  • Thank you, that works!  Any ideas how to format the number or date?
    Friday, March 4, 2016 2:53 PM
  • Hi,

    as the Format function isn't available in UI macros the only thing that comes to my mind would be some tinkering with string and date functions like:

    Concat(Day([BB_date]),"/",Month([BB_date]),"/",Right(Year([BB_date]),2))

    This should almost create the date format of your example (only missing the leading zero).

    I don't know what's your problem or wish for the number format but maybe you can do sth with Len() or Replace(), which are available in UI macros.


    cu
    Karl
    Access FAQ (de/it): donkarl.com
    Access Lobby: AccessDevelopers.org

    Friday, March 4, 2016 4:01 PM
  • Great, thanks for helping out.

    Giacomo

    Friday, March 4, 2016 5:49 PM