Field Size Change in VBA

P

Pat

Here's the code I have, but I get the message "Invalid
Operation":

Public Sub pChangeSize()
On Error GoTo pChangeSizeError

Dim db As Database
Dim tableName As String
Dim tbd As TableDef
Dim thisField As Field

Set db = CurrentDb
Set tbd = db.TableDefs("tempWebInspReport")
Set thisField = tbd.Fields("Estab_id")
With tbd
thisField.Size = thisField.Size + 1
End With

pChangeSizeError:
MsgBox Error$, 0, "Restaurant Database"
Exit Sub
End Sub

I have about 100 tables I need to change the size of 1
field in. I can do it manually, but the database is
about 150 miles away! Any suggestions??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top