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

Possible to add field on the fly?

Status
Not open for further replies.

Frank123

MIS
Sep 17, 2001
77
US
Ideally I'd like to add a new field ( Yes/No ) to a table on the fly. Is there a way to do this in access. At the time I have a Insert query built to add new records but if I could just add a new field to an existing record it would greatly reduce the size of my database.

Thanks
 
It depends. What do you mean by "on the fly"? If it's a multiuser database, and other users are in it, there's probably no reliable way do it without risking exclusive control conflicts.

If it's a single-user database and you want to add a column in VBA code, it's not hard. Just use DoCmd.RunSQL to execute a DDL "ALTER TABLE" statement (see the Help file for syntax). You must close all forms, queries, etc. that use the table before you run the DDL.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top