Good Day all, @Orange, The Sun is up in Wales so WGM will beat you to this one
I am trying add a selected amount of records based on 1 order number
So if a Customer has got 20 x orders on 1 x Order No i am wanting to for example add 3 more so we end up with 23
when i try the code below, I have added 3 when prompted by iInput then 35 records are added and not 23!!!
Code:
Dim x As Integer, iInput As Integer
Dim strSQL As String, strOrderNo as String
If Me.cboStatus = "Duplicate" Then
iInput = InputBox("Enter How Many Records To Duplicate ?")
For x = 1 To iInput
strSQL = "INSERT INTO tblEdit " _
& "SELECT tblEdit.* " _
& "From tblEdit " _
& "WHERE (((tblEdit.OrderNo)= '" & strOrderNo & "'));"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
Me.Status = "Planning"
Next
If Me.Dirty Then Me.Dirty = False
Me.cboDelTo.SetFocus
Me.cboDelTo.SelStart = 0
Forms!frmMainMenu!frmIndex1DS.Requery
Debug.Print strSQL
End If