How to get table's name and field's name?

  • Thread starter Thread starter XS
  • Start date Start date
Thanks Douglas!

I am not a programming person. Could you show me how to "create a recordset
that returns one or more rows of data and loop through the fields in that
recordset"? I am sorry I dont know how to write in VB......

Many thanks!
 
No offence, but if you're not a programming person, you may have bitten off
a little more than you should have, as automating one application from
another is a relatively complicated process.

The easiest approach would be to change

For lngField = 0 To db.TableDefs(lngTable).Fields.Count - 1
lngRow = lngRow + 1
With wbExcel.Sheets(1)
.Range("A" & lngRow) = db.TableDefs(lngTable).Name
.Range("B" & lngRow) = _
db.TableDefs(lngTable).Fields(lngField).Name
.Range("C" & lngRow) = _
db.TableDefs(lngTable).Fields(lngField).Size
.Range("D" & lngRow) = _
db.TableDefs(lngTable).Fields(lngField).Type
.Range("E" & lngRow) = _
DLookup(Fields(lngField).Name, db.TableDefs(lngTable).Name)
End With
Next lngField


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


XS said:
Thanks Douglas!

I am not a programming person. Could you show me how to "create a
recordset
that returns one or more rows of data and loop through the fields in that
recordset"? I am sorry I dont know how to write in VB......

Many thanks!
 
Thanks again Douglas,

I got error message on "Fields"(DLookup(Fields(lngField).Name............)
says "sub or function not defined"

Should I define it first?

Thanks for your comment. I am not programer. I need to do this, since
otherwise I need to summerize 600+ table by hand...I think I sould learn
more...

Many thanks!
 
Hi Douglas,

I change it to "......DLookup(db.TableDefs(lngTable).Fields(lngField).Name,
db.TableDefs(lngTable).Name)", and it seems work!!!!

Thank you very much!!! You really help a lot!
 
Don't need to sorry. Really thank you! You save me at least one week of time,
instead doing that task manually.
 
I need to do this, since
otherwise I need to summerize 600+ table by hand...I think I sould learn
more...

Have you investegated Tools... Analyze... Documenter?
 
Back
Top