What is wrong with this code
It has an error and i dont see anythign wrong with it at all, can anyone point me to my fault.
Code:
Private Sub Command161_Click()
On Error GoTo Err_Command161_Click
Dim num As Integer
Dim Test As String
Dim MainVal As String
Dim varInfoID As String
Dim varAppealID As String
Dim varAppeal As String
Dim strSQL As String
varAppeal = Me.Combo4.Value
varAppealID = DLookup("AppealID", "ProposedAppealNames", "Appeal Name=" & varAppeal)
num = 1
Do While x < 26
If IsEmpty(cbo & " " & num) Then
x = x + 1
Else
MainVal = cbo & " " & x
varInfoID = DLookup("ID1", "ProposedInformationToCapture", "Information=" & MainVal)
strSQL = "INSERT INTO Appeals([AppealID],[InfoID]) VALUES ('" & varAppealID & "','" & varInfoID & "')"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
x = x + 1
End If
Loop
Exit_Command161_Click:
Exit Sub
Err_Command161_Click:
MsgBox Err.Description
Resume Exit_Command161_Click
End Sub
It has an error and i dont see anythign wrong with it at all, can anyone point me to my fault.