Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2014, 07:33 AM
Smithy02468 Smithy02468 is offline Concatenate two textbox values for message box Windows 7 64bit Concatenate two textbox values for message box Office 2010 64bit
Novice
Concatenate two textbox values for message box
 
Join Date: Oct 2014
Posts: 9
Smithy02468 is on a distinguished road
Default Concatenate two textbox values for message box


I was wondering if anybody knows how to concatenate the output from two textboxes for use in a message box?


Below is the code i have and i want to display

Lookup for (Value of Textbox 1 and Value of Textbox 2) not found.

I thought and ampersand would do the trick but it comes up with an error

MsgBox "Lookup for " & TextBox1.Text Textbox2.Text " not found"

Any suggestions appreciated

Regards

Colin
Reply With Quote
  #2  
Old 11-08-2014, 10:48 PM
gmayor's Avatar
gmayor gmayor is offline Concatenate two textbox values for message box Windows 7 64bit Concatenate two textbox values for message box Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,104
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You need to add ampersands between each element (and presumably the 'and' between the text box values).
Code:
MsgBox "Lookup for " & TextBox1.Text & " and " &  TextBox2.Text & " not found"
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate two textbox values for message box Concatenate function for displaying numbers in words officeboy09 Excel 13 08-09-2021 12:59 PM
Concatenate two textbox values for message box Display result in textbox based on the input of another textbox scarymovie Word VBA 5 05-16-2012 07:05 PM
Concatenate two textbox values for message box Open new message in outlook using values from a word document mattbennion Word VBA 1 12-21-2011 07:23 PM
If, move and concatenate in VBA devcon Excel Programming 0 07-04-2011 12:44 AM
Concatenate two textbox values for message box Concatenate/merge contents of multiple cells PSYloco Excel 2 05-14-2011 03:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:36 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft