Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106

    Unanswered: Concatenate message on an Access Form

    Hi,

    I am trying to display a two part message on a message box to be able to have a variable displayed in the middle of the message. For Example the message will be like this:

    The next available number is [Defined Variable]; do you want to use this number?

    I have more code after that based on the response, but I have no problem with that. I just can't get the text before and after the number to display.

    Thanks for your help.
    Mo

  2. #2
    Join Date
    Dec 2001
    Posts
    79
    Try this:

    dim s as string
    s = "The next available number is " & MyVarName & "; do you want to use this number?"
    msgbox s

    or

    dim s as string
    s = "The next available number is " & MyVarName & "; do you want to use this number?"
    if msgbox(s,vbyesno) = vbyes then
    '* Continue
    else
    Go To Exit_Section
    endif

    Exit_Section:
    End Sub

    Hope this helps,
    Peter De Baets
    Peter's Software - Microsoft Access Tools for Developers
    http://www.peterssoftware.com

  3. #3
    Join Date
    Oct 2002
    Location
    Hartford, CT
    Posts
    106
    Originally posted by pdebaets
    Try this:

    dim s as string
    s = "The next available number is " & MyVarName & "; do you want to use this number?"
    msgbox s

    or

    dim s as string
    s = "The next available number is " & MyVarName & "; do you want to use this number?"
    if msgbox(s,vbyesno) = vbyes then
    '* Continue
    else
    Go To Exit_Section
    endif

    Exit_Section:
    End Sub

    Hope this helps,


    That helped, thanks a lot.
    Mo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •