473,785 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1315
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("MyTa ble").Fields("M yField").Proper ties.Delete
"Descriptio n"

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**@NorthStat e.net> wrote in message
news:1q******** *************** *********@4ax.c om...
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.
xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxx
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("MyT able").Fields(" MyField").Prope rties.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
1905
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 all the ones I've looked at so far have major drawbacks. What I'm looking for in an object-relational wrapper layer is:
1
10809
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 INTEGER NOT NULL, TIMEKEY_DTTM DATETIME NULL,
4
5084
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 recreation of the relationships. Code is: Sub Woof() Dim dbs As Database Dim fld As Field, rel1 As Relation, rel2 As Relation Set dbs = CurrentDb
2
2312
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 field PK. This code works when executed from a module (both DAO and ADO work), but not from the query window. DELETE a1.*, a2.Field1 FROM a1 LEFT JOIN a2 ON a1.Field1 = a2.Field1 WHERE (((a2.Field1) Is Null));
3
11821
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 if any tables have been addedd to A and if so, programatically creating a linked table to the new tables? Failing this, can I programatically delete all linked tables, then link re-link to every table which appears in tableA?
18
18419
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 a remote update of tables and fields and can't find enough information on these things. Also, how do you index a field in code?
1
6024
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 there are no vaules in the column. I then could delete this column and move on to the next column. Anybody know the commands to sum the column, and proceed to the next one (without knowing the name of the next column)? I'd like to do this with...
9
2530
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 using search criteria", "Delete the current record" and so on. After a user has used the search criteria to find a specific record, I would like to use the "delete" function on the form to not only delete the record, but also update another table. ...
4
2197
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 variable in it. When you changed the private variable it would also change the variables in the Property definition. But when I do it, I only get the property definition but no variables in it: public int MyProperty { get; set; }
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.