Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Posts
    5

    pass a variable to the MsgBox function

    Is it possible to pass a variable to the MsgBox function. I need to let my user know what item is associated with part they are trying to update.

    I was wandering if I could use: MsgBox "Part is currently locked by item Number:" & variable & .

    As you can see I have no clue what the syntax would be, even if this is possible. If this is not possible I am open to suggestions.

  2. #2
    Join Date
    Dec 2006
    Posts
    8
    This is possible, though I'm not exactly sure what the syntax is for a string & a variable, but this is how I usually use just a variable.

    Dim varNumber As Long
    varNumber = 1200
    MsgBox varNumber

    That would display 1200 for you, but I'm not quite sure how to get the other text that you are looking for in front of it.

  3. #3
    Join Date
    Apr 2007
    Location
    Portsmouth, VA
    Posts
    5
    Your format is correct, except you forgot the quotes around the period at the end.

    MsgBox "Part is currently locked by item Number:" & variable & "."

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

Similar Threads

  1. Replies: 0
    Last Post: 10-04-2008, 07:23 AM
  2. Passing a value from a variable to an update query
    By MUKUDU99 in forum Programming
    Replies: 0
    Last Post: 08-24-2008, 11:14 PM
  3. Variable question
    By synapse5150 in forum Programming
    Replies: 1
    Last Post: 07-09-2008, 08:17 AM
  4. Need help - Record set based on a program variable
    By ericargent in forum Programming
    Replies: 1
    Last Post: 09-19-2007, 08:57 PM
  5. Replies: 0
    Last Post: 03-19-2006, 11:52 PM

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