Step 10: But if we use numbers instead of strings to concatenate using “+” symbol it will perform concatenation only not addition because we took the data type as a string, not an integer. Step 8: As we are adding two strings we can use “+” symbol also as below. Press the play button and go to you excel and check will get the result in cell(4,7) (row 4 and column 7). Step 7: Assign the concatenation in cell address cell(4,7) and remove msgbox as we no more need of message box. Instead of a message box if we want in excel itself we can do that. Step 6: Now the result is coming in the message box. Instead of India, I changed to sweets now we will run and check. Step 5: If we change the data in the excel and re-run the program results will change as per the excel data. Step 4: The data is taking from excel shown below. Now execute the process by clicking on play symbol. Step 3: Because of this whatever the data in cells(4,4) and Cells(4,5) will combine and store in full_string. As usual, concatenate both strings using the ampersand operator. Step 2: Observe the above image, we assigned the value in cells(4,4) to stirng1 and cells(4,5) in string2. For that assign the data in the cells to string1 and string2 as shown below. Step 1: Now we will take the data from the excel sheet and concatenate and then display results. In case if we want to add ‘-‘ we can do that also. Step 9: Observe the above image we added the space between string1 and string2 with the help of double-quotes.
#Ms access concatenate how to
How to add space then? Very simple while concatenating, concatenate space also. Step 8: In the above example we took the two strings directly in the program and there is no space between the first string and second string. The result will appear in the message box as below. Click on the play button which is marked with red color box. Step 7: Now, it’s time to execute the process. Display this string using a message box as below. Step 6: Now, concatenation of both string1 and string2 is stored in full_string.
Keep a space between string variables and ampersand operator to avoid error message. Step 5: Now, combine the string1 and string2 using ampersand operator and assign that combination to full_string as below. Step 4: Now, we need to assign the string “I love” to string1 and “India” to string2 using “=” assignment operator as below.ĭim String1 As String Dim String2 As String Dim full_string As String Step 3: In Subprocess we need to define strings like string1, string2, and full_string using the keyword dim.ĭim String1 As String Dim String2 As String Dim full_string As String End Sub To initiate subprocess, use keyword Sub and process name “concatenation”. Step 2: First, we need to create a subprocess with any name like concatenation.
Step 1: Go to the Developer tab and then select the “visual basic” tab on the left-hand side.