Search results

  1. J

    Creating Tables in VB

    Hi All, I have some code in a sub: On Error Resume Next DoCmd.RunSQL "DROP TABLE tblParcels" 'This deletes the table if it already exists. Dim tblParcels As TableDef 'Create the table Set tblParcels = db.CreateTableDef("tblParcels") 'Define the table Dim fldURN As...
  2. J

    Adding Autonumber with MakeTable query

    Thanks both... Think I was missing the point a little!
  3. J

    Adding Autonumber with MakeTable query

    Hi wiklendt, I could do an append query but I still don't know how to populate the autonumber field. eg I have a table that's got one column, fld. I want my query to produce a new table, with two columns: an autonumber ID and fld.
  4. J

    Adding Autonumber with MakeTable query

    Hello all, I have a MakeTable query, which effectively just filters data from an existing table, but I want to add an autonumber field column to it. Looking around the internet it seems this isn't as straight forward as I'd hoped! Seems like it should be simple, as I'm sure it's a common thing...
  5. J

    Writing to a table

    Thanks - you may only have been spitballing but I've done some more playing around based on what you've said and I think I've cracked it. rst is a recordset but I'd used it earlier to represent a different table, and I hadn't been closing and setting to nothing - AND I was running the code...
  6. J

    Writing to a table

    Hello, I'm writing some VBA in Access, part of which is to write to a table. I'm using this: Set db = CurrentDb Set rst = db.OpenRecordset("tblParcels") rst.AddNew rst!ID = 1 rst!URN = "TEST" rst.Update this = rst!URN MsgBox this However, when I run the code and then look at the table no...
Back
Top Bottom