Create new field

abenitez77

Registered User.
Local time
Today, 07:14
Joined
Apr 29, 2010
Messages
141
I tried creating a new field using variables like this:

nFldType = "dbText"
nFldSize = "20"

tdf.Fields.Append tdf.CreateField(TblCol, nFldType, nFldSize)

But it does not like "dbText", when I use this it works:
tdf.Fields.Append tdf.CreateField(TblCol, dbText, nFldSize)

How can i get it to work with a variable in place? I have it in a function where it loops and creates decimal, text, currency, etc....
 
what happens if you do this?
nFldType = dbText
nFldSize = 20

I can't see how you defined your fields, but the field size should be an integer, not a string, so I removed the quotes.
 
why are you doing this in code?
just design the table and add the field.
 

Users who are viewing this thread

Back
Top Bottom