Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 131,348 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,646 people online right now. Registration is fast and FREE... Join Now!




Sudoku Program Help

 
Reply to this topicStart new topic

Sudoku Program Help, need help debugging sudoku program

Alexiel
post 23 Feb, 2008 - 08:18 PM
Post #1


New D.I.C Head

*
Joined: 19 Jan, 2008
Posts: 6

CODE
Private Sub Command1_Click()
Dim a1, b1, c1, d1, e1, f1, g1, h1, i1 As Integer
Dim a2, b2, c2, d2, e2, f2, g2, h2, i2 As Integer
Dim a3, b3, c3, d3, e3, f3, g3, h3, i3 As Integer
Dim a4, b4, c4, d4, e4, f4, g4, h4, i4 As Integer
Dim a5, b5, c5, d5, e5, f5, g5, h5, i5 As Integer
Dim a6, b6, c6, d6, e6, f6, g6, h6, i6 As Integer
Dim a7, b7, c7, d7, e7, f7, g7, h7, i7 As Integer
Dim a8, b8, c8, d8, e8, f8, g8, h8, i8 As Integer
Dim a9, b9, c9, d9, e9, f9, g9, h9, i9 As Integer
Dim at, bt, ct, dt, et, ft, gt, ht, it, total As Integer

a1 = a1.Caption
b1 = b1.Text
c1 = c1.Text
d1 = d1.Text
e1 = e1.Text
f1 = f1.Text
g1 = g1.Caption
h1 = h1.Text
i1 = i1.Text

a2 = a2.Text
b2 = b2.Caption
c2 = c2.Caption
d2 = d2.Text
e2 = e2.Text
f2 = f2.Caption
g2 = g2.Caption
h2 = h2.Text
i2 = i2.Text

a3 = a3.Caption
b3 = b3.Text
c3 = c3.Text
d3 = d3.Text
e3 = e3.Caption
f3 = f3.Caption
g3 = g3.Text
h3 = h3.Text
i3 = i3.Text

a4 = a4.Text
b4 = b4.Text
c4 = c4.Text
d4 = d4.Text
e4 = e4.Caption
f4 = f4.Caption
g4 = g4.Text
h4 = h4.Text
i4 = i4.Text

a5 = a5.Caption
b5 = b5.Text
c5 = c5.Text
d5 = d5.Caption
e5 = e5.Text
f5 = f5.Text
g5 = g5.Text
h5 = h5.Text
i5 = i5.Caption

a6 = a6.Text
b6 = b6.Text
c6 = c6.Text
d6 = d6.Caption
e6 = e6.Caption
f6 = f6.Text
g6 = g6.Text
h6 = h6.Text
i6 = i6.Text

a7 = a7.Text
b7 = b7.Text
c7 = c7.Text
d7 = d7.Caption
e7 = e7.Caption
f7 = f7.Text
g7 = g7.Text
h7 = h7.Text
i7 = i7.Caption

a8 = a8.Text
b8 = b8.Text
c8 = c8.Caption
d8 = d8.Caption
e8 = e8.Text
f8 = f8.Text
g8 = g8.Caption
h8 = h8.Caption
i8 = i8.Text

a9 = a9.Text
b9 = b9.Text
c9 = c9.Caption
d9 = d9.Text
e9 = e9.Text
f9 = f9.Text
g9 = g9.Text
h9 = h9.Text
i9 = i9.Text

at = a1 + b1 + c1 + d1 + e1 + f1 + g1 + h1 + i1
bt = a2 + b2 + c2 + d2 + e2 + f2 + g2 + h2 + i2
ct = a3 + b3 + c3 + d3 + e3 + f3 + g3 + h3 + i3
dt = a4 + b4 + c4 + d4 + e4 + f4 + g4 + h4 + i4
et = a5 + b5 + c5 + d5 + e5 + f5 + g5 + h5 + i5
ft = a6 + b6 + c6 + d6 + e6 + f6 + g6 + h6 + i6
gt = a7 + b7 + c7 + d7 + e7 + f7 + g7 + h7 + i7
ht = a8 + b8 + c8 + d8 + e8 + f8 + g8 + h8 + i8
it = a9 + b9 + c9 + d9 + e9 + f9 + g9 + h9 + i9

total = at + bt + ct + dt + et + ft + gt + ht + it

Select Case total

Case Is = 405
lbl1 = " Puzzle Solved! "

Case Else

lbl1 = "Something is Wrong"

End Select

End Sub


When I click the command button an error occurs saying invalid qualifier then my i1.Text is highlighted in yellow. when I changed the name it highlighted i2.Text

can somebody help me with this please even an alternative coding procedure is welcome.

if it helps I coded the given numbers as labels and the missing numbers as textboxes. then i add the first column up to the ninth. then i add all the columns.

i've attached the form try checking it too...it's in winzip

This post has been edited by Alexiel: 24 Feb, 2008 - 12:01 AM


Attached File(s)
Attached File  Sudoku_Program.zip ( 3.49k ) Number of downloads: 28
User is offlineProfile CardPM

Go to the top of the page


LookNAO
post 25 Feb, 2008 - 09:53 AM
Post #2


D.I.C Head

**
Joined: 28 Dec, 2007
Posts: 66



Thanked 1 times
My Contributions


You are trying to Dimension A1, but then you are referring to it as a label (a1.caption). You can't do that....

If I have a command button Command1 and I try to Dim Command1 as an integer, it will error out...

Use something different with your variable names or change your object names...
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/19/08 04:26PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month