Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Insert a row into a Table

Status
Not open for further replies.

bitwise

Programmer
Mar 15, 2001
269
US
How can I programmatically (in VBA) insert a row into a table specifying where the row should go, its name, and its datatype?

Thank You,
-bitwise

ExampleTable
Name1, Type
Name2, Type
Name3, Type
--------->Insert here via VBA (Name#, Type)
Name4, Type
Name5, Type
 


Hi

Not sure what you mean by inserting a row in a specific location: Tables are there to store information. They can always be sorted and 'altered' at a later stage.

I'm not even sure that you can manually enter data in a specific location - Access isn't Excel.

Stew "Even a stopped clock tells the right time twice a day."
 
I think what you are wanting to do is create a new field or column

using DAO

DIM DB as database, tbl as tabledef
dim fld as field
set db= currentdb
set tbl=db.tabledefs("tablename")
set fld = tbl.createfield("fieldname",dblong)
tbl.fields.append fld


 


Must learn to read the questions!!

Stew "Even a stopped clock tells the right time twice a day."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top