Increment number based on list box

N

Net Admin

Hello. I'm creating a bid database for a company to track their sales
efforts. What I'm trying to do is automatically generate a proposal number
based on the region selected from a list box in a form. So the list box has
the options North, South, East, and West. The following text box is where I
want the proposal number to auto-gen. So if somebody chooses North, I would
want that text box to show a number of 07050001 and keep incrementing from
there to 07050002, 07050003, and so on. I must be writing my VB functions
wrong because I can't accomplish this! Can somebody throw an idea or
suggestion at me to get this done? Is there a macro that can accomplish this
maybe? Thank you for the help.
 
D

Dan Artuso

Hi,
Let's take a look at what you need to make this happen.
First, you have to be storing the 'number' somewhere, right?
I say 'number' because the format you're using is not numerical.
There can be no leading 0's in any number format.

So what you have to be doing is storing the number and then formating it
for display purposes.

You can have a table to store just the one value and keep incrementing it.
So for example, you have 7050001 stored in a table. When you need to assign
a number, grab the value from the table, assign it, then update the table value by incrementing it by one.

Hope that gets yopu going.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top