Hello every one. I'm stuck please help. I just started working with VBA.
Heres my scenario. I have 2 tables: tblBox(BoxNumber) and tblFiles(FileNumber) with 1:M rel'ship.
I'm using a form for user input containing a drop down list cboBoxNumber, a save button, and 2 text boxes txtFileNumberStart and txtFileNumberEnd. Currently when users physically box files, they would number the box and write down the file numbers inside the box. The file numbers are in numerical order starting from 1. I'm trying to emulate this process.
On the form, users would select the box number from the drop down and type the range of files numbers using txtFileNumberStart and txtFileNumberEnd. This is better than having user type 1,2.3 and so on. I realize that I need to do a loop but I'm not having luck with my loop. It is not inserting any values to the table. For simplicity, I removed the dropdown, I just want the range of file numbers to work at this point.
Dim LintCount as Integer
Dim Counter as Integer
LintCount = Me.txtFileNumberEnd .Value - Me.txtFileNumberStart.Value
Counter = 1
Do While Counter <= LintCount
RunSQL = "INSERT INTO tblFiles(FileNumber) VALUES(Counter)"
Counter = Counter + 1
Loop
Any help is much appreciated. Thanks!