G
Guest
Hello everyone. I'm new to vba so please bear with me. I would like to
insert a range of numbers based on user input. For example, if the user puts
5 to 60, it should insert: 5,6,7,8... in tblFiles.FIleNumber. I have
something like this but it's not working. It has to do with my counter I
think. I'm using Access 2003. Thanks for all help.
Private Sub cmdSave_Click()
Dim FileCount as integer
Dim Counter as integer
FileCount= Me.txtTo.Value - Me.txtFrom.Value
Counter = 1
Do While Counter <= FileCount
RunSQL = "INSERT INTO tblFiles(FileNumber) Values (Counter)"
Counter = Counter + 1
Loop
End Sub
insert a range of numbers based on user input. For example, if the user puts
5 to 60, it should insert: 5,6,7,8... in tblFiles.FIleNumber. I have
something like this but it's not working. It has to do with my counter I
think. I'm using Access 2003. Thanks for all help.
Private Sub cmdSave_Click()
Dim FileCount as integer
Dim Counter as integer
FileCount= Me.txtTo.Value - Me.txtFrom.Value
Counter = 1
Do While Counter <= FileCount
RunSQL = "INSERT INTO tblFiles(FileNumber) Values (Counter)"
Counter = Counter + 1
Loop
End Sub