delete field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I delete fields OriginalLnm & OriginalFnm from tblTest? I want to
first check to see if those fields exists. If they do, then delete the fields.
 
I found some code to delete specific fields. This works great except if one
of the fields is deleted manually. This may happen periodically. How do I
check to see if the field exists first, if it does not, then I want to delete
all the fields except the ones that don't exist.
 
you can loop through fields for example:

dim fld as dao.field

for each fld in rst.fields
if fld.name=strNameLookingFor then
'field exists!
exit for
end if
next fld

rst - is a recordset, you can also use tabledef
 
Back
Top