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

comparing the structure of 2 tables 1

Status
Not open for further replies.

primerov

Technical User
Aug 16, 2002
160
0
0
BG


I am updating and appending 2 idential tables. The functions work fine, but only in case
the tables are identical.For example, if the in the first table Table1, i have added on more row
which doesnt exist in the other table Table2. then i receive an error. I want somehow toi inform the
user that he has to import the right table Table1 with a message. Is it possible to do it
Somehow of the kind :
If Table2 is not equal to Table1 Then............
 
maybe somethig like this

Function CompareTables()
Set Sele1 = currentdb.openrecordset("Table1")
Set Sele2 = currentdb.openrecordset("Table2")

if Sele1.Fields.Count <> Sele2.Fields.Count then
Bad Not the Same

else

For I = 0 to Sele1.fields.count - 1
if sele1.fields(I).Name <> sele2.fields(I).Name then
Bad Bad Not the Same

and so on...

Hope that helps.


Ascii dumb question, get a dumb Ansi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top