Help in arresting a syntactic Error

Dhruva

Member
Joined
Sep 23, 2004
Messages
12
Programming Experience
Beginner
Hi,

I just started learning VB.NET. I have designed a simple form and two text boxes and 5 buttons includines one exit button.
On clicking one button, some text needs to be displayed on the text boxes. I was trying to assign that text into the text property of the textboxes.
I was getting an error message there saying that "expression expected".

PrivateSub customerrelationsButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles customerrelationsButton.Click

telephonenumberTextbox.text =
'626-500-1111'

departmentcontactTextbox.Text = 'Tricia Mills'



EndSub


Could you let me know what could be the problem here? Also please let me know if you require more information for this.

 

Schenz

Well-known member
Joined
Sep 11, 2004
Messages
181
Location
Cincinnati, OH
Programming Experience
5-10
Change your single quotes to double quotes:

VB.NET:
[size=2][color=#0000ff]Private[/color][/size][size=2][color=#0000ff]Sub[/color][/size][size=2] customerrelationsButton_Click([/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] sender [/size][size=2][color=#0000ff]As[/color][/size][size=2] System.Object, [/size][size=2][color=#0000ff]ByVal[/color][/size][size=2] e [/size][size=2][color=#0000ff]As[/color][/size][size=2] System.EventArgs) [/size][size=2][color=#0000ff]Handles[/color][/size][size=2] customerrelationsButton.Click
 
   telephonenumberTextbox.text = [color=black]"[/color][/size][size=2][color=#008000][color=black]626-500-1111"[/color]
 
   [/color][/size][size=2]departmentcontactTextbox.Text = [/size][size=2][color=#008000][color=Black]"Tricia Mills"[/color]
 
[/color][/size][size=2][color=#0000ff]End[/color][/size][size=2][color=#0000ff]Sub
[/color][/size]
 
Top Bottom