Create new field in existing table exactly like field in second table 
Author Message
 Create new field in existing table exactly like field in second table

I need to add a new field to a table which has all of the properties as an
existing field in a second table (i.e., same name, type, size, description,
etc.).  I can do it manually by opening the source table, highlighting the
field in table design mode and doing a copy and then pasting it into the
destination table.

Is there a way to do the same thing in a VBA module?

Thanks in advance,

Alan Pulsipher



Mon, 29 Jul 2002 03:00:00 GMT  
 Create new field in existing table exactly like field in second table
You can use the Fields collection in VBA or the AlterTable
command in SQL.
Quote:

>I need to add a new field to a table which has all of the properties as an
>existing field in a second table (i.e., same name, type, size, description,
>etc.).  I can do it manually by opening the source table, highlighting the
>field in table design mode and doing a copy and then pasting it into the
>destination table.

>Is there a way to do the same thing in a VBA module?

>Thanks in advance,

>Alan Pulsipher



Mon, 29 Jul 2002 03:00:00 GMT  
 Create new field in existing table exactly like field in second table
Thanks for the advice; however, I already realized that I could write a long
piece of code that will go through the fields collection and examine every
property of every field I need to copy and then duplicate those in the new
fields collection.

I was hoping there was an easier way, or that maybe someone might have
already written something like that.  I guess what I'm really looking for is
a "tdf.fields.copy fldOld" method.  Unfortunately, I don't think that exists
in Access.

I'm still hoping there is an easy answer out there somewhere.

Thanks,
Alan

Quote:

>You can use the Fields collection in VBA or the AlterTable
>command in SQL.



Tue, 30 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to modified existing field and add new field in existing table for Access database

2. Create new fields in a table based off of fields in another table

3. Adding new fields to an existing table

4. Add New Field in existing Table (VB6)

5. Adding a new field to an existing table via ADOX

6. Create Field in existing table??

7. Create Field in Existing Table

8. updating fields in table from field in another table

9. VB3 appending a field to a table, then entering data into the new field

10. Fill field in one table from field in another table

11. Create table from a combined field in another table

12. Creating new fields in Access tables using ADO 2

 

 
Powered by phpBB® Forum Software