![]() |
|
|
#1
|
|||
|
|||
|
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! |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| multiple fields in separate records | Fredo0709 | Database Design | 9 | 04-09-2010 10:23 AM |
| Saving records in multiple sub forms | niak32 | Forms | 0 | 10-13-2008 02:24 AM |
| Linking Multiple records | rricci@marcct.org | Programming | 0 | 02-14-2008 06:18 AM |
| Search for multiple records | Blake | Queries | 0 | 10-30-2006 12:04 PM |
| How do I choose multiple records for a report | admaldo | Reports | 2 | 03-03-2006 03:02 AM |