B
Baby Face Lee
Hello folks,
Below is some code that I'd be grateful if you'd look over and tell me what
I've done wrong.
I'm trying to get the outer loop and inner loop to increase by one each time
so that the SQL is acting open each of the 12 sets of controls in the form.
The outer loop seems to work fine but the inner loop is stuck at the first
control. I know this should be easy but I'm stuck again!!
X = 1
Y = 1
For X = 1 To 12
varEstCode = Me("cboEstCode" & X)
If IsNull(varEstCode) Then
Exit For
End If
For Y = 1 To 12
strCands = Me("txtCands" & Y)
strSQL = "INSERT INTO tbl_Estimates (CentreNo, EstCode, Cands)" _
& " VALUES (" & Me!cboCentreNo & ", " & "'" & varEstCode & "'" &
", " & strCands & ");"
db.Execute strSQL
Exit For
Next
Next
Thanks for any help/advice you can give.
Regards,
Lee
Below is some code that I'd be grateful if you'd look over and tell me what
I've done wrong.
I'm trying to get the outer loop and inner loop to increase by one each time
so that the SQL is acting open each of the 12 sets of controls in the form.
The outer loop seems to work fine but the inner loop is stuck at the first
control. I know this should be easy but I'm stuck again!!
X = 1
Y = 1
For X = 1 To 12
varEstCode = Me("cboEstCode" & X)
If IsNull(varEstCode) Then
Exit For
End If
For Y = 1 To 12
strCands = Me("txtCands" & Y)
strSQL = "INSERT INTO tbl_Estimates (CentreNo, EstCode, Cands)" _
& " VALUES (" & Me!cboCentreNo & ", " & "'" & varEstCode & "'" &
", " & strCands & ");"
db.Execute strSQL
Exit For
Next
Next
Thanks for any help/advice you can give.
Regards,
Lee