ok this might be real easy for u guys.. ;)
Heres my VB code for the program. The codes used are based from other codes and tips from this forum. So far generating right numbers for all 9 row and 9 columns works well.


My code has 2 arrays..
1) Numbers(81) for the 81 squares in sudoku board
2) Check(9), additional array which stores used numbers from 1 to 9
'81 array for the 81 squares
Dim Numbers(80) As Integer
Dim Index As Integer
'initialize the random # generator.
Private Sub Form_Load()
Index = 0
Randomize
End Sub
'generate random numbers
Public Function Rand(ByVal Low As Long, _
ByVal High As Long) As Long
Rand = Int((High - Low + 1) * Rnd) + Low
End Function
'POPULATE SUDOKU
Private Sub cmdPopulate_Click()
Dim Number As Integer
Dim Check(9) As Integer
Dim CheckIndex As Integer
Dim Loops As Integer
Dim Col As Integer
Dim Row As Integer
Dim X As Integer
Dim Y As Integer
Dim ColIndex As Integer
CheckIndex = 0
X = 0
Y = 0
'fills 81 squares with random numbers from 1 to 9
For Index = 0 To 80
Number = Rand(1, 9)
'stores the numbers inside Numbers(80) array
Numbers(Index) = Number
Next Index
'loops 0 to 8 time, each time it loops y + 9
For Loops = 0 To 8
'loops 0 to 8 time, every time it loops x + y = index
For X = 0 To 8
Index = X + Y
'Check() is an array which represents 9 digits from 1 to 9
'each time this numbers is used in the puzzle, the array will mark 1
'if number is not used at all, array will mark 0
'first, fills Check() with 0. Since no number has been tried
For CheckIndex = 1 To 9
Check(CheckIndex) = 0
Next CheckIndex
'start checking each row and column
'used numbers is assign to Check()
For CheckIndex = 1 To 9
'Check Row
For Row = 0 + Y To 8 + Y
'each time a number is used inside the row, array marks 1
If Numbers(Row) = CheckIndex Then
Check(CheckIndex) = Check(CheckIndex) + 1
End If
'Check Column
For Col = Index - Y To 72 + Index - Y Step 9
'check to make sure column is less then 81
If Col <= 80 Then
'each time a number is used inside the column, array marks 1
If Numbers(Col) = CheckIndex Then
Check(CheckIndex) = Check(CheckIndex) + 1
End If
End If
Next Col
lblCheck(CheckIndex).Caption = Check(CheckIndex)
Next Row
Next CheckIndex
'now all the used numbers will be replace with the unused numbers.
If Index <= 80 Then
For CheckIndex = 1 To 9
'numbers with 0 value means it has not been used
'this will replace used numbers
If Check(CheckIndex) = 0 Then
Numbers(Index) = CheckIndex
txtBox(Index).Text = " " & CheckIndex & " "
lblDisplay.Caption = "FILLED!"
End If
Next CheckIndex
End If
Next X
Y = Y + 9
Next Loops
End Sub


thanks.
-haN!-