What's Here?
- Members: 340,125
- Replies: 920,439
- Topics: 154,931
- Snippets: 4,855
- Tutorials: 1,257
- Total Online: 4,054
- Members: 119
- Guests: 3,935
|
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!
Chat LIVE With a Expert
|
lab database
lab database
can u solved my problem
Rate Topic:
   

- New D.I.C Head
-
-
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
Posted 23 May 2009 - 03:07 AM
VB2008 => VB.NET.

- apt-get install DIC.bin
-
-
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

- apt-get install DIC.bin
-
-
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
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
Posted 23 May 2009 - 11:15 AM
searockruz, 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

- New D.I.C Head
-
-
Group:
Members
-
Posts:
17
-
Joined:
22-May 09
Dream Kudos: 0
Posted 23 May 2009 - 07:32 PM
PsychoCoder, 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()

- apt-get install DIC.bin
-
-
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?

- New D.I.C Head
-
-
Group:
Members
-
Posts:
17
-
Joined:
22-May 09
Dream Kudos: 0
Posted 23 May 2009 - 09:30 PM
PsychoCoder, 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]
Posted 23 May 2009 - 09:39 PM
ankiesiau, 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
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users
|
Be Social
Programming
Web Development
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|