Saving tbl structure from one database to another

N

Noel

I have a "test" database that I am working on and making changes in as we
have staff that work in the "current" database. I need to save the structure
of the tblmember from the "test" database to the "current" database. When I
try to copy/paste, I get the error: "You can't delete the table "tlMember'
until its relationships to other tables have been deleted. How do I get the
structure to the tbl, qry, etc?

Thanks
 
N

Noel

I can do that, but then it just saves the tbl with a number on the end. I
just want to save the definition or structure of the table to the original
table that is there. I still want the data that is in the original table
also.
 
J

John W. Vinson

I can do that, but then it just saves the tbl with a number on the end. I
just want to save the definition or structure of the table to the original
table that is there. I still want the data that is in the original table
also.

If the table is already there, then its STRUCTURE is already there. Do you
want to save the fieldnames and datatypes? Do they need to replace existing,
different fieldnames and datatypes? Or do you want to save the data???

What is in the two tables now (tablenames, fieldnames, data)? What do you want
to be there?
 
N

Noel

I have added more field names and possibly some rewording or spelling
corrections. I want the data from the "current" database to be there but I
want to update the table with the new information I have added.
 
J

John W. Vinson

I have added more field names and possibly some rewording or spelling
corrections. I want the data from the "current" database to be there but I
want to update the table with the new information I have added.

Then you'll need to do one of three things:

1. Open the table in design view and manually make the same changes. This is
by far the simplest.

2. Run a DDL (Data Definition Language) SQL query to alter the table
structure:

ALTER TABLE mytable ADD COLUMN newcolumn TEXT(255);

See the Help for ALTER for specifics.

3. Write VBA code to add or change fields in your table; see the VBA help on
the Tabledef object.

There is no "import" process which will do this.
 
N

Noel

I tried the import and not all of my data imported. In the table that I am
trying to import shows 12060 records and when I open the table in the
database that I imported it to, it only shows 12013 records. Why is that?
 
J

John W. Vinson

I tried the import and not all of my data imported. In the table that I am
trying to import shows 12060 records and when I open the table in the
database that I imported it to, it only shows 12013 records. Why is that?

I'm sorry, we're talking at complete cross purposes here.

Earlier in the thread you were talking about changing the field definitions of
the table.

Now you're talking about importing data.

Please step back and realize that we're volunteers, and cannot see your screen
nor read your mind. Please explain what you are trying to do; how you're
trying to do it; the structure of your tables; and post any code or queries
that you're using.
 
N

Noel

Sorry to waste your time.


John W. Vinson said:
I'm sorry, we're talking at complete cross purposes here.

Earlier in the thread you were talking about changing the field definitions of
the table.

Now you're talking about importing data.

Please step back and realize that we're volunteers, and cannot see your screen
nor read your mind. Please explain what you are trying to do; how you're
trying to do it; the structure of your tables; and post any code or queries
that you're using.
 
D

David W. Fenton

It's your time you're wasting. I would like to help, but I do not
understand what help you are asking for.

For what it's worth, if all you want to do is import/export a table
structure, DoCmd.TransferDatabase offers an optional argument,
[StructureOnly], to accomplish that for you. I didn't realize that
myself until I looked it up in preparation for participating in this
thread (which turned out not to be about that at all). Perhaps the
fact that I've pointed it out will help somebody who also comes
along thinking the thread is actually about what the subject says.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top