Okay, I am not familiar with the array approach, but I can see that would be valuable for me to learn it.
In the mean time, I have taken abald's tip and have attempted to accomplish what I sent out at the beginning to achieve, and I have run in to a problem.
Originally, I wanted to extract the number portion of the ID because I am having problems when I try to add a new customer ID after GW-100. When I do a 'Select' on all Customer IDs with 'GW' in them and then sort them so I can find what the last one is and then add '1' to it. For some reason Access (or VB) doesn't sort the way I would like for it to sort. GW-100 ends up at the top of my order and it keeps adding '1' to GW-99 and getting GW-100. So, I keep getting multiple GW-100 IDs. Not good.
So, I opened this thread to see if there was a way in VB to extract the GW and the 100 separately. Thanks to your help, I found that I can.
I then tried utilizing that bit of code in a 'Select' statement, and it is blowing up:
Code:
Set numdb = CurrentDb
Set numrst = numdb.OpenRecordset("select Mid([CustomerID], iPlace + 1) As CustID from Contacts WHERE CustomerID Like '" & labelID2 & "*' ORDER BY CustID")
It is saying 'too few parameters'. I hope to get from that statement the numbers 1 through 100 so that I can simply add '1' and make the next record '101'!
What a mess! I figure there has got to be an easier way. The reason I need to do the CustomerID like this is that I have several different users who each need to query on their own 'GW' value, so I need to keep my customers in groups but also need to add them incrementally.
Help!