School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
Welcome to Dream.In.Code
Become an Expert!

Join 340,125 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 4,054 people online right now. Registration is fast and FREE... Join Now!



lab database

Page 1 of 1

lab database can u solved my problem Rate Topic: -----

#1 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 23 May 2009 - 02:10 AM

I am using visual basic 2008 express edition.I got some error message.
Can anyone solved my problem.

Error 1 Name 'numcourses' is not declared.what is means?


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		If [b]numcourses[/b] >= 8 Then
			MsgBox("You are only allowed to enter 8 classes", , "Error")
			Exit Sub

This post has been edited by ankiesiau: 23 May 2009 - 02:15 AM

Was This Post Helpful? 0
  • +
  • -


#2 firebolt  Icon User is offline

  • D.I.C Lover
  • Icon
  • View blog
  • Group: Author w/DIC++
  • Posts: 5,555
  • Joined: 20-February 09


Dream Kudos: 1675

Posted 23 May 2009 - 03:07 AM

VB2008 => VB.NET.
Was This Post Helpful? 0
  • +
  • -

#3 PsychoCoder  Icon User is offline

  • apt-get install DIC.bin
  • Icon
  • View blog
  • Group: Admins
  • Posts: 16,211
  • Joined: 26-July 07


Dream Kudos: 12400

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

Posted 23 May 2009 - 03:47 AM

Moved to VB.NET :)
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • apt-get install DIC.bin
  • Icon
  • View blog
  • Group: Admins
  • Posts: 16,211
  • Joined: 26-July 07


Dream Kudos: 12400

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

Posted 23 May 2009 - 04:23 AM

That's a simple one, it's saying that numcourses hasn't been declared. Show us where you've declared this variable.

Also, you're using VB.NET now, stop using MsgBox and start using the MessageBox Class. MsgBox is a legacy items left over from the VB6 days :)
Was This Post Helpful? 0
  • +
  • -

#5 searockruz  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 459
  • Joined: 07-March 09


Dream Kudos: 0

Posted 23 May 2009 - 04:26 AM

have you declared numcourses as integer

Dim numcourses is Integer

i suggest you learn basic of vb.net
Was This Post Helpful? 0
  • +
  • -

#6 TechWar  Icon User is offline

  • D.I.C Regular
  • PipPipPip
  • Group: Members
  • Posts: 469
  • Joined: 17-February 09


Dream Kudos: 0

Posted 23 May 2009 - 11:15 AM

View Postsearockruz, on 23 May, 2009 - 04:26 AM, said:

have you declared numcourses as integer

Dim numcourses is Integer

i suggest you learn basic of vb.net

You might mean as.
so be a little nicer

anyway, yeah, I still catch myself using msgbox :crazy: :D
Was This Post Helpful? 0
  • +
  • -

#7 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 23 May 2009 - 07:32 PM

View PostPsychoCoder, on 23 May, 2009 - 04:23 AM, said:

That's a simple one, it's saying that numcourses hasn't been declared. Show us where you've declared this variable.

Also, you're using VB.NET now, stop using MsgBox and start using the MessageBox Class. MsgBox is a legacy items left over from the VB6 days :)


Dim [b]k[/b] As Integer
		Dim [b]temp[/b] As String
		ReDim Preserve students(arraysize).courses(numcourses)
		If numcourses = 0 Then
			'redim students(arraysize).courses(0)
			ListBox1.Items.Clear()

Was This Post Helpful? 0
  • +
  • -

#8 PsychoCoder  Icon User is offline

  • apt-get install DIC.bin
  • Icon
  • View blog
  • Group: Admins
  • Posts: 16,211
  • Joined: 26-July 07


Dream Kudos: 12400

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

Posted 23 May 2009 - 07:59 PM

I see you declaring k and temp, where are you declaring numcourses?
Was This Post Helpful? 0
  • +
  • -

#9 ankiesiau  Icon User is offline

  • New D.I.C Head
  • Pip
  • Group: Members
  • Posts: 17
  • Joined: 22-May 09


Dream Kudos: 0

Posted 23 May 2009 - 09:30 PM

View PostPsychoCoder, on 23 May, 2009 - 07:59 PM, said:

I see you declaring k and temp, where are you declaring numcourses?



[code]Dim k As Integer
Dim temp As String
ReDim Preserve students(arraysize).courses(numcourses)
If numcourses = 0 Then
'redim students(arraysize).courses(0)
ListBox1.Items.Clear()
End If
students(arraysize).first = UCase(TextBox1.Text)
students(arraysize).last = UCase(TextBox2.Text)
students(arraysize).semester = UCase(TextBox3.Text)
students(arraysize).HSgradyear = UCase(TextBox4.Text)
students(arraysize).IDnumber = UCase(TextBox5.Text)
students(arraysize).courses(numcourses).coursenumber = UCase(TextBox6.Text)
students(arraysize).courses(numcourses).instructor = UCase(TextBox7.Text)

temp = Str(numcourses + 1) & ") " & students(arraysize).courses(numcourses).coursenumber & " " & students(arraysize).courses(numcourses).instructor
'ListBox1.Items.Add("ID#: " & "" & students(arraysize).IDnumber)
ListBox1.Items.Add(temp)
numcourses = numcourses + 1
'TextBox1.Text = ""
'TextBox2.Text = ""
'TextBox3.Text = ""
'TextBox4.Text = ""
'TextBox5.Text = ""
TextBox6.Text = ""
TextBox7.Text = ""
TextBox7.Focus()[code]
Was This Post Helpful? 0
  • +
  • -

#10 Damage  Icon User is offline

  • D.I.C Addict
  • Icon
  • Group: Contributors
  • Posts: 983
  • Joined: 05-June 08


Dream Kudos: 75

Posted 23 May 2009 - 09:39 PM

View Postankiesiau, on 23 May, 2009 - 09:30 PM, said:

Dim k As Integer
		Dim temp As String
		ReDim Preserve students(arraysize).courses(numcourses)
		If numcourses = 0 Then
			'redim students(arraysize).courses(0)
			ListBox1.Items.Clear()
		End If



see your declaring k as an integer and temp as a string but you don't appear to be declaring numcourses as anything before you use it
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month