Re: Increment number based on list box
From: Dan Artuso (dartuso_at_NOSPAMpagepearls.com)
Date: 03/15/05
- Next message: Gina: "Re: Select query with a date as param"
- Previous message: Jeff Boyce: "Re: Copying only a few fields from a record to a new record"
- In reply to: Net Admin: "Increment number based on list box"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Mar 2005 08:33:25 -0500
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.
-- HTH ------- Dan Artuso, MVP "Net Admin" <NetAdmin@discussions.microsoft.com> wrote in message news:3C76006F-093C-4781-8B2F-9D77D85A5373@microsoft.com... > 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.
- Next message: Gina: "Re: Select query with a date as param"
- Previous message: Jeff Boyce: "Re: Copying only a few fields from a record to a new record"
- In reply to: Net Admin: "Increment number based on list box"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|