Link to home
Start Free TrialLog in
Avatar of meng_97
meng_97

asked on

Error in Access: Too many fields defined

After installing my application in offices, "run time error '3190' - Too many fields defined" occurs when I tried to create an addtional field in one of my tables in MS Access at run time. I clicked on Help button and it says I exceeded the 255 field limit. My table has only 15 fields and an average of 10,000 records.


Private Sub Text8_KeyPress(KeyAscii As Integer)
Dim ws As Workspace
Dim db As Database
Dim CheckTicket, TempRec As Recordset
Dim td As TableDef
Dim fld As Field

    Select Case KeyAscii
        Case vbKeyReturn, vbKeyTab
            StatusBar1.Panels(1).Text = "Please wait..."
            Set ws = DBEngine.Workspaces(0)
            Set db = ws.OpenDatabase("c:\btfb\btfb.mdb")
            Set td = db.TableDefs("trnxfile")
            Set fld = td.CreateField("temp", dbInteger)
            td.Fields.Append fld <-The error occurs here

Avatar of tirupur_selva
tirupur_selva
Flag of United States of America image

Hi,
   Do you get the error message the very first time or after a fewtimes the keypress event is fired?.
Avatar of anthonyc
anthonyc

on the second keypress, you are attempting to add a second field called TEMP.... You can't name a field the same thing twice!
ASKER CERTIFIED SOLUTION
Avatar of tirupur_selva
tirupur_selva
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial