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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check to see if Table Field Exists in VBA

Status
Not open for further replies.

rittiger15

Technical User
Apr 21, 2003
6
US
I have a database that imports data from previous versions of the same database. The problem I run into is that one of the fields changed names since the first version.

Version 1
field name = FIELDA

Version 2
field name = FIELDB

I need the database to look at the table and determine which version it is importing data from so that it knows which query to run. I was hoping for something like:

If Table1.FIELDA exists then
query1
else
query2
end if

Is this possible?? I can't find a way to reference table fields in VBA.

I am open to any suggestions, whether I need to change my SQL or code or both.

Thanks in advance,
Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top