Okay, try specifying the fields then. For example,
INSERT INTO temp (Field1, Field2, Field3) VALUES (Value1, Value2, Value3)
Thanks for your patience
Hi no joy I am afraid this is the full code for that command button, The line in bold text gets highlighted in yellow?
Private Sub Btn_Generate_Click()
Dim i As Integer
Dim RS As Recordset
'Check the form has been filled in correctly
'Check that start and end numbers have been entered
If IsNull(Me.Start_Number) Or IsNull(Me.End_Number) Then
MsgBox "You must have a value in the start number and end number boxes"
End
'Check that start and end numbers are valid numbers
ElseIf IsNumeric(Me.Start_Number) = False Or IsNumeric(Me.End_Number) = False Then
MsgBox "Only numbers are allowed in the start number and end number boxes)"
End
End If
'Check for apostrophes and replace with double apostrophes to avoid an error when executing the RUNSQL statement
Me.Address = Replace(Me.Address, "'", "''")
DoCmd.SetWarnings False
'Clear the Temp table
DoCmd.RunSQL "DELETE * FROM temp"
'Set the number of labels to produce
i = Me.Start_Number
'Keep adding new records starting at the provided start number until the end number is reached
While i <= Me.End_Number
DoCmd.RunSQL "INSERT INTO temp VALUES('" & Me.Address & "','" & i & "','" & Me.Of_Number & "')"
i = i + 1
Wend
DoCmd.SetWarnings True
'Generate the Label Sheet
DoCmd.OpenReport "Seed Labels correct spacing numbered", acViewPreview
End Sub