The errors involve the statement I made for what to say after the command button is clicked. Here is the sentence I wrote:
'create message message = "You have entered " firstName & " " & lastName & " as a new customer." vbCR firstName & "'s address is: " & streetAddress & "," & city & "," & state & "," & zipCode & "."
THE TWO indented areas indicate the start of the lines {meaning that in the program it only takes up two lines}
the & sign {after firstName} which connects the statement of variables and string literals together has an error that reads "Method arguments must be enclosed in parentheses"
Then for the same sign, there is another error "Expression is expected."
for the string literal 'firstName' the error reads "Expression is not a method."
And the last error reads "End of statement expected" for the first line of my sentence.
How do I fix these errors? I wrote the sentence out how I was instructed to by my professor, did I make an error in writing it? {She didn't give the exact sentence to write, just how to write it.}
HELP!
MsgBox(Message)
message = message & firstName & "'s address is: " & streetAddress & "," & city & "," & state & "," & zipCode & "."
Also, may I ask what version of the language you are doing this in? Is this in .NET?
Code: message = "You have entered " & firstName & " " & lastName & " as a new customer." & vbCrLf & firstName & "'s address is: " & streetAddress & "," & city & "," & state & "," & zipCode & "." Thats the correct way to do it. btw, make sure thats all on 1 line.
Thats the correct way to do it.
btw, make sure thats all on 1 line.
Make sure the whole sentence is on line one? Shouldn't you write it on two lines?
Thanks, the code you pasted did get rid of the errors, but the & sign in front of firstName on the second line still says syntax error.
You need an & right before the variable firstname
It got rid of the errors for the & sign but now says "syntax error"