473,387 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Seeking A97 code snippet to programatically delete table field decriptions

MLH
In design view, say you habitually type descriptions for each of
the table fields you create. After many moons, many many tables
and many many many fields - you wanna delete each and every
table field description. Can that be done somehow using the
tables collection and the fields collection??? Any resource you
care to point out will be greatly appreciated.
Nov 13 '05 #1
2 1290
You can:
- Loop through the TableDefs collection.
- Loop through the Fields collection in each TableDef.
- Use the Delete method on the Properties of the Field.

The basic reference is:
dbEngine(0)(0).TableDefs("MyTable").Fields("MyFiel d").Properties.Delete
"Description"

Use error handling: you will get an error (3270 from memory) if the field
has no Description.

For an example of looping the Fieldds of a TableDef and refering to the
Description property, see:
http://allenbrowne.com/func-06.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"MLH" <CR**@NorthState.net> wrote in message
news:1q********************************@4ax.com...
In design view, say you habitually type descriptions for each of
the table fields you create. After many moons, many many tables
and many many many fields - you wanna delete each and every
table field description. Can that be done somehow using the
tables collection and the fields collection??? Any resource you
care to point out will be greatly appreciated.

Nov 13 '05 #2
MLH
That was a quick reply. Many thx, Allen. Will check
out your site momentarily.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx
You can:
- Loop through the TableDefs collection.
- Loop through the Fields collection in each TableDef.
- Use the Delete method on the Properties of the Field.

The basic reference is:
dbEngine(0)(0).TableDefs("MyTable").Fields("MyFie ld").Properties.Delete
"Description"

Use error handling: you will get an error (3270 from memory) if the field
has no Description.

For an example of looping the Fieldds of a TableDef and refering to the
Description property, see:
http://allenbrowne.com/func-06.html


Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: aum | last post by:
Hi, I'm looking for an object-relational layer, which can wrap a MySQL database into highly pythonic objects. There seem to be dozens of packages which provide some of this functionality, but...
1
by: Patrizio | last post by:
Hi All, I've the following table with a PK defined on an IDENTITY column (INSERT_SEQ): CREATE TABLE MYDATA ( MID NUMERIC(19,0) NOT NULL, MYVALUE FLOAT NOT NULL, TIMEKEY ...
4
by: Jenni | last post by:
Hopefully someone out there can help. I am currently trying to write some code to allow me to delete a table, then recreate it and re-establish the relationships. I seem to have hit a snag in the...
2
by: Matthew Wells | last post by:
I want to delete records from the "one" table of a one to may relationship. There are no actual Access relationships set up. The "one" table has a single field PK and the "many" table has a two...
3
by: Tym | last post by:
OK - daft question of the day time... If I have database A which contains all the live data, and Database B which contains linked tables to those is A (i.e. a front end) is there a way of seeing...
18
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on...
1
by: idta | last post by:
Hi there, I have a table full of numbers. I want to delete all the columns that do not have ANY numbers in the rows under the column. I assume I could sum the column, and if the sum is 0, I know...
9
by: hrreece | last post by:
I have an Access 2002 database that has a form that can be used to review individual records. At the bottom of the form are buttons that are linked to functions that allow the user to "Find a record...
4
by: tshad | last post by:
I was watching a video that used a code snippet to create a property and when you type "prop" tab tab, it would create the private variable as well as the property definitions with the private...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.