Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

list of numbers

Discussion in 'Information Technology' started by Karen, Jul 28, 2006.

Tags:
  1. Karen

    Karen
    Expand Collapse
    Guest

    Hi,

    I would like to generate a list of numbers, starting at 2000, incrementing
    by 1 each time, and ending at 3000. How would I go about this?

    Thanks.
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News How The Left & Indian Nationalists Distorted The History Of Sikh Gadhar Movement - Breaking News Sep 21, 2016
    Interfaith Materialists And Its Discontents Interfaith Dialogues Jun 10, 2016
    Sikhi Quasi-Pragmatists And Quasi-Spiritualists, Care To Explain? Sikh Sikhi Sikhism Jun 6, 2016
    Cholesterol Is Finally Officially Removed From "naughty List" Health & Nutrition Feb 11, 2016
    Listening to Gurbani while driving?? Sikh Rehat Maryada Jan 13, 2016

  3. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    Where?
    Another column in a query/Report/Form?
    Add values to a table?

    --
    Good Luck
    BS"D


    "Karen" wrote:

    > Hi,
    >
    > I would like to generate a list of numbers, starting at 2000, incrementing
    > by 1 each time, and ending at 3000. How would I go about this?
    >
    > Thanks.
     
  4. Larry Linson

    Larry Linson
    Expand Collapse
    Guest

    "Karen" wrote

    > I would like to generate a list of numbers,
    > starting at 2000, incrementing by 1 each time,
    > and ending at 3000. How would I go about this?


    Dim intX as Integer, intC as Integer
    intX = 1999
    For intC = 1 To 1001
    intX = intX + 1
    Debug.Print intX
    Next intC

    This code will generate the "list" of numbers you describe, printing each to
    the Immediate Window. However, I'd wager you actually want to do something
    with the generated numbers, for example, save them in an array, or write
    them in separate records to a table, or write them as records to a
    sequential file... if you'd be specific about what you want, then perhaps
    someone can give you guidance about what you'd need to substitute for
    "Debug.Print intX" to accomplish your purpose.

    Larry Linson
    Microsoft Access MVP
     
  5. KARL DEWEY

    KARL DEWEY
    Expand Collapse
    Guest

    If you use the autofill in Excel that is an easy way.

    Create a table with an autonumber field and one other number field.

    Create a query using any table that has a hundred or more records. Include
    the table a half dozen times. In the design grid add X: 1 in a blank
    column. Changer the query to an append query to append to the table you
    created above. Set the maximum number of records from "All" to 3001. Run
    the query.

    The autonumber field now contains numbers from 1 through 3001.

    "Karen" wrote:

    > Hi,
    >
    > I would like to generate a list of numbers, starting at 2000, incrementing
    > by 1 each time, and ending at 3000. How would I go about this?
    >
    > Thanks.
     
  6. Karen

    Karen
    Expand Collapse
    Guest

    I'd like the list of numbers to be the records in a tblAllNumbers with a
    field called number. In tblSelectedNumbers I have a field called number. I
    plan to use the find unmatched query wizard to generate a list of records
    (well, numbers) that were not used in tblSelectedNumbers.

    "Larry Linson" wrote:

    > "Karen" wrote
    >
    > > I would like to generate a list of numbers,
    > > starting at 2000, incrementing by 1 each time,
    > > and ending at 3000. How would I go about this?

    >
    > Dim intX as Integer, intC as Integer
    > intX = 1999
    > For intC = 1 To 1001
    > intX = intX + 1
    > Debug.Print intX
    > Next intC
    >
    > This code will generate the "list" of numbers you describe, printing each to
    > the Immediate Window. However, I'd wager you actually want to do something
    > with the generated numbers, for example, save them in an array, or write
    > them in separate records to a table, or write them as records to a
    > sequential file... if you'd be specific about what you want, then perhaps
    > someone can give you guidance about what you'd need to substitute for
    > "Debug.Print intX" to accomplish your purpose.
    >
    > Larry Linson
    > Microsoft Access MVP
    >
    >
    >
     
  7. Ofer Cohen

    Ofer Cohen
    Expand Collapse
    Guest

    Something like

    Dim MyDB As DAO.Database, MyTab As DAO.Recordset, I As Integer
    Set MDB = CurrentDb
    Set MyTab = MyDB.OpenRecordSet("Select [Number] From tblAllNumbers")
    For I = 2000 to 3000
    MyTab.AddNew
    MyTab![Number] = I
    MyTab.Update
    Next I
    ==============
    I suggest you change the field name [Number] which it a key word in Access.

    --
    Good Luck
    BS"D


    "Karen" wrote:

    > I'd like the list of numbers to be the records in a tblAllNumbers with a
    > field called number. In tblSelectedNumbers I have a field called number. I
    > plan to use the find unmatched query wizard to generate a list of records
    > (well, numbers) that were not used in tblSelectedNumbers.
    >
    > "Larry Linson" wrote:
    >
    > > "Karen" wrote
    > >
    > > > I would like to generate a list of numbers,
    > > > starting at 2000, incrementing by 1 each time,
    > > > and ending at 3000. How would I go about this?

    > >
    > > Dim intX as Integer, intC as Integer
    > > intX = 1999
    > > For intC = 1 To 1001
    > > intX = intX + 1
    > > Debug.Print intX
    > > Next intC
    > >
    > > This code will generate the "list" of numbers you describe, printing each to
    > > the Immediate Window. However, I'd wager you actually want to do something
    > > with the generated numbers, for example, save them in an array, or write
    > > them in separate records to a table, or write them as records to a
    > > sequential file... if you'd be specific about what you want, then perhaps
    > > someone can give you guidance about what you'd need to substitute for
    > > "Debug.Print intX" to accomplish your purpose.
    > >
    > > Larry Linson
    > > Microsoft Access MVP
    > >
    > >
    > >
     

Share This Page