|
-
Apr 12th, 2002, 03:14 PM
#1
Thread Starter
PowerPoster
table element data types in Access
I need to display the data types off all elements in an Access db table. I can do it for forms but can't figure out how to do it for tables with either VB or VBA. Any suggestions? I'm using Access 2000 & VB 6.0 and don't care whether I do it inside Access w/ VBA, or externally w/ VB
Thanks for your time
Paul Hinds
[email protected]
-
Apr 12th, 2002, 04:02 PM
#2
Hyperactive Member
VB Code:
Dim dbs As Database
Dim tdf As TableDef
Dim fld As Field
Set dbs = CurrentDb
On Error Resume Next
txtResults.SetFocus
txtResults.Text = ""
For Each tdf In dbs.TableDefs
For Each fld In tdf.Fields
txtResults.SetFocus
txtResults.Text = fld.Name & ": " & fld.Type
Next fld
Next
Set dbs = Nothing
Hope that get's you started
-
Apr 12th, 2002, 04:36 PM
#3
Thread Starter
PowerPoster
configuration issue?
Your code looks good to me and I thank you, but I seem to have a configuration problem (?) since all I get is an immediate error message complaining that "Database" is an a user defined data type that is not defined. This happens whether I put the code in Access VBA or into VB 6.0
-
Apr 12th, 2002, 04:54 PM
#4
New Member
Have you set the references to use the 'DAO 3.6 object library'?
If so set it to higher priority than the'Active X Data Objects library'
-
Apr 12th, 2002, 05:25 PM
#5
Thread Starter
PowerPoster
outstanding !!!
How on earth does one figure that out ? I mean, it strikes me as about as far from intuitive as you can get. I understand that "experience" is the basic answer, but the on-line help was no help at all on this one. (Unless it's one of those Microsoft specialties where it's really easy to figure out the answer provided you already know the answer so you know exactly what quesiton to ask)
Anyway, thank you very much.
-
Apr 12th, 2002, 05:38 PM
#6
New Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|