Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Records by Entering Range - How?

Status
Not open for further replies.

tmpark

Technical User
Nov 15, 2002
24
0
0
US
I need to be able to create records by entering a range.

This would be like having an ID# field and being able to create new record #s 100 - 150. Each row would have the same values that were entered in other fields on the form.

The wrench in all of this is that our ID#s follow the format of 000-0000 or 000-0000-0000 (obviously these are our internal Ids not the pkeys). So, for instance, we may want to enter numbers 050-0700 through 050-0850 OR 030-0200-0001 through 030-0200-0100.

Does this make sense?

I'm invisioning something that would separate the numbers - identify the last four numbers in the string - and then loop as many times as it takes to make the first number = the second number - each time inserting a row based on the data in the form. I may be way off. Thanks for your time.

Trent
 
I think you have it exactly right...go through and grab the last four numbers and store the rest to add back on later. Then loop through, adding one every time and creating the new record. Then before you move on to create the next record just add the other data for that record (coming from the controls on your form). Hope that helps.

Kevin
 
Kevin,

Thanks for the tips. I guess the trouble is that even though I have a pretty goog understanding of the logic, I'm not a programmer by any means. Would you know how to put together the VB to make this work?

Thanks-
Trent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top