Drop field from table

C

cynthia

How would I go about removing a field from an existing table through vb code?
I would appreaciate any help on this. I posted another question on excel
imports yesterday and cannot find it in the forum, so my posts may be having
issues.

Thank you in advance for any help you can give me.
 
F

fredg

How would I go about removing a field from an existing table through vb code?
I would appreaciate any help on this. I posted another question on excel
imports yesterday and cannot find it in the forum, so my posts may be having
issues.

Thank you in advance for any help you can give me.

CurrentDb.Execute "ALTER Table [YourTableName] DROP [FieldName]"
 
C

cynthia

Thank you thank you thank you I have been searching everywhere for this
information. It works like a charm.
--
Cynthia


fredg said:
How would I go about removing a field from an existing table through vb code?
I would appreaciate any help on this. I posted another question on excel
imports yesterday and cannot find it in the forum, so my posts may be having
issues.

Thank you in advance for any help you can give me.

CurrentDb.Execute "ALTER Table [YourTableName] DROP [FieldName]"

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
 
F

fredg

Thank you thank you thank you I have been searching everywhere for this
information. It works like a charm.

If you are only deleting a control on occasion that may be fine, but
just remember that there is a maximum number of 754 controls you can
add to a form over it's lifetime, so while it's easy enough to add or
delete a control, even though you have deleted it, it still counts
towards that 754 number. Don't do this on a regular basis on a form.
See Specifications in Access help.
 
F

fredg

If you are only deleting a control on occasion that may be fine, but
just remember that there is a maximum number of 754 controls you can
add to a form over it's lifetime, so while it's easy enough to add or
delete a control, even though you have deleted it, it still counts
towards that 754 number. Don't do this on a regular basis on a form.
See Specifications in Access help.

Oooops! Sorry. Regarding Access Specifications, I sleepily assumed
that we were talking about deleting 'controls' from a form, not a
field from a table.
Ignore my previous post.
 
C

cynthia

I may be confused, I am dropping a field from a table, does this rule apply
to tables?
 

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