Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find out if a FIELD exists.

Status
Not open for further replies.

joebb3

Programmer
Feb 27, 2006
87
US
In my endevour to create an upgrade sub for my application, I have hit a wall (again! :) )

I can find out if a table exists, but what about a field inside a table? It seems that everything I do gives me an error and brings everything to a stop.

As a SIDE question, is an easy way to add a default or initial entry for every record in the new field?

You guys rock!
Joe
 
You can loop through the feilds collection. I'll see if I have a code snippet for your reference... or u can search for that term... should be lots of examples on inet. htwh,

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Each field in the table definition has a default value property you can set.

DAO allows you to open the tabledef and loop through the fields collections. ADO allows you to open a recordset and loop through the fields collections
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top