I am extremely new to programming and a have a piece of code that is not working for me. I have tried to upload my database as I think it would be much easier for someone with experience to look at it rather than me try to explain it. I am still getting acquainted with the lingo. However, MY file size is 1.53 MB and apparently there is a restriction of 55 kb allowed. I have pasted a dropbox link for the database. At any rate, what I am trying to accomplish is have the user enter information into a form, click a button and based upon the number that the user enters into an unbound text field on the form, it adds that many new records to the bound table. I have a looping code to accomplish this but it keeps giving me an error and referencing the first line of code. I have double checked the spelling and button name and don't see why it would not work or, at least why it won't move past the first line. Any help is appreciated.
Here is the code too in case an error can be spotted without downloading the database.
Private Sub cmdAddFLPurchaseOrders_Click()
On Error GoTo cmdAddFLPurchaseOrders_Click_Err
On Error Resume Next
Dim i As Integer
Dim FLPOTable As String
Dim rs As DAO.Recordset
FLPOTable = "tblLumberPurchases"
Set rs = CurrentDb.OpenRecordset(FLPOTable)
With rs
For i = 1 To Me.NumPONeededFL - 1
.AddNew
.Fields!CompanyName = Me.CompanyName
.Fields!Mill = Me.Mill
.Fields!LumberProducts = Me.LumberProducts
.Fields!MillPrice = Me.MillPrice
.Fields!Plants = Me.Plant
.Fields!Delivered = Me.Delivered
.Update
Next i
.Close
End With
DoCmd.Requery ""
Me.NumPONeededFL = ""
cmdAddFLPurchaseOrders_Click_Exit:
Exit Sub
cmdAddFLPurchaseOrders_ClickErr:
MsgBox Error$
Resume cmdAddFLPurchaseOrders_Click_Exit
End Sub
Here is the dropbox link for the database being referenced.
https://www.dropbox.com/s/u85fdg87s3...%29.accdb?dl=0