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!

Field name in a table?

Status
Not open for further replies.

easycode

Programmer
Jan 28, 2005
195
US
I need to pull a fieldname from a table, does anyone know how to do it?

i have a table called Subject:
-Subjectcode
-Description
-Type
-Notes
-Alertmess
-Date

i need to verify by code if this table has the field "Alertmes" because in previous versions instead of this field i have "Alertcode". Then How can i get the name of a field?

Thanks
 
Brute force ...
[tt]dim fld as dao.field
on error resume next
set fld = currentdb.tabledefs("subject").fields("Alertmes")
if err.number <> 0 then ' err 3265 I think
' doesn't look like it's there
end if
on error goto <ordinary errorhandler>[/tt]

Roy-Vidar
 
i was thinking in something like that, i was hoping there was a command to do it automatically.

Thank you Roy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top