Need help trying to compare table field names in access

BKLounger

Golden Member
Mar 29, 2006
1,098
0
0
So here is the setup I have two tables inside of an access database. What I want to do is create a command that somehow compares the field name in column 1 of table1 and field name in column 1 of table2. and so on and so forth for about 50 headers. Then spit out a box saying Mismatch if it is not able to match all column headers.

Also I am trying to figure out some code or a query that will check all entries in a specific column and if they all say the same thing (a specific phrase). Then it will say invalid.

I am still a bit new to access programming and any help or even direction is greatly appreciated.
 

KLin

Lifer
Feb 29, 2000
30,210
559
126
It's possible. Look up the fields collection(DAO) in the VBA help file and check out the example. There's code that will output properties of a table, specifically the the recordset portion. You can extract field names from the list of recordset properties, populate strings and do a string comparison between the 2 tables. That's how I would do it.

Another option would be to goto tools, analyze, and print out the specs for both tables and look at them on paper side by side.