Re: How to populate sequential numbers in a field using SQL or VBA?



x = 100

Do While Not rst.EOF

rst.edit
rst![ID] = x
rst.update

x = x +1
rst.movenext
Loop

"Excel 009" <excelmodeling@xxxxxxxxx> wrote in message
news:87e4f2ef-3e8f-4842-aa06-174af4e5991d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

Is there a way to populate sequential numbers in a field using SQL or
VBA? If yes, how?

Assume the following is my existing table:

Fruit ID
Apply
Banana
.
.
Orange

and I want to populate the ID field with 100, 101, 102.....

(I do not want to use append query with autonumber field.)

Excel 009



.



Relevant Pages

  • Re: Resetting a field property from text to Autonumber in Access 2002
    ... You can create a table with the same structure, add the AutoNumber, and use ... Create a query using the old table. ... Change it to an Append query ... I've exported the table to excel, changed the field to a number value, ...
    (microsoft.public.access.tablesdbdesign)
  • RE: import from excel to access
    ... Sorry, Vector, I don't know a way to do what you are describing with a Macro. ... Do you code in VBA at all? ... > of data import from excel to access. ... I then have an append query that validates the data ...
    (microsoft.public.access.externaldata)
  • Re: Help please:-Passing parameters to a query from a module
    ... >I don't know any VBA but need to pass a range of dates to an append query. ... all the dates in the desired range (you can do this quickly in Excel). ... Date literals in Access MUST be in either mm/dd/yy or an ...
    (microsoft.public.access.queries)
  • How to populate sequential numbers in a field using SQL or VBA?
    ... Is there a way to populate sequential numbers in a field using SQL or ... VBA? ... (I do not want to use append query with autonumber field.) ... Excel 009 ...
    (comp.databases.ms-access)
  • Import Excel into Access table.
    ... I need help on coding with vba away to import an Excel ... spreadsheet into a temporary table,then run a append query ...
    (microsoft.public.access.modulesdaovba)

Loading