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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add a integer column to a table with VBA 2

Status
Not open for further replies.

vamoose

Programmer
Oct 16, 2005
320
MX
I am using Access 2000 and trying to find the correct syntax to add an integer column named "Line" to table named "ABS_Report" Thank you for the help.
 
This should work

Code:
sql="ALTER TABLE ABS_REPORT ADD LINE INTEGER"
DOCMD.RUN SQL

I tried to have patience but it took to long! :) -DW
 
Almost
Code:
sql="ALTER TABLE ABS_REPORT ADD [red]COLUMN[/red] LINE INTEGER"
DOCMD.RUN SQL
 
I can see that would be easier to read, but I tried what I posted and it worked in Access 2k also what you posted worked and is correct way. Thanks for correcting me :)

I tried to have patience but it took to long! :) -DW
 
That worked great, thanks alot. Both of you please accept a star.

Due to the nature of the database, which has alot of duplicate data, now I also need to add a second column in which will it be autonumbered so that I may step through the records one at a time. Can this be added in the same manner as before ? Thanks again.
 
Same idea
Code:
sql="ALTER TABLE ABS_REPORT ADD COLUMN Anum COUNTER(1,1)"
DOCMD.RUN SQL
 
So, that's what I was missing, Counter(1,1). Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top