Dixie wrote:
I am looking for code that will check if a field (fieldname) exists
in a certain table (tablename), then to add it if it does not. Can
anyone guide me in the right direction. I think I can add the field,
but I need to know how to find if the field is already there.
TIA
dixie
CurrentDB.TableDefs("TableName").Fields("FieldName ").Name
Will return the name of the field if it exists or raise an error if it doesn't.
You can either loop through all fields testing for the name you are looking for
or just do the above and trap for the error.
--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com