Re: Increment number based on list box

From: Dan Artuso (dartuso_at_NOSPAMpagepearls.com)
Date: 03/15/05


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.


Relevant Pages

  • Re: Increment Number Format
    ... You can't use an Autonumber to accomplish this. ... > I have a incrementing AutoNumber field set up for an Invoice Numbering> System. ... > I would like to format the number like this and increment it by 1 each time> I create an Invoice. ...
    (microsoft.public.access.forms)
  • ZPack update
    ... of note, a few additions have been made to the format, in particular: ... building an indexing structure and storing it to disk may make sense. ... index structure at load time, which may make the most sense for directories ... nature of the format (most implementations of b-trees I have seen have been ...
    (comp.compression)
  • Re: Standards question on edited fields
    ... > Who said I was storing it? ... and it seems you would not present such a format to ... it's not a sloppy design at all - and there is a valid reason. ... Judson McClendon ...
    (comp.lang.cobol)
  • Re: 2D height map to 3D model?
    ... (you're storing 12 doubles for almost every data-point). ... If you have a format that allows for triangle/quadrilateral strips, ... can make the rendering far more efficient using them. ...
    (comp.lang.python)
  • Re: Formatting Time As hhmmss Gives Me Dates Instead?
    ... better than incrementing the time: ... Then I applied the format, ... For example, if I enter 000000, the cell shows 000000, and the formula bar ...
    (microsoft.public.excel.worksheet.functions)