If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
CreateField error
Hi,
I am using Access97 on Windows XP desktop and the following references: Visual basic VBA322.DLL Access 8.0 Object Library Common controls 6.0 Word 10.0 DAO 2.5/3.5 The following code generates a "Method or data member not found" error on the CreateField. Set tdf = dbs.TableDefs!Patients Set idx = tdf.CreateIndex("PatientIDIndex") Set fld1 = idx.CreateField("OpNoteID") Any ideas? Thanks in advance, Max |
#2
|
|||
|
|||
The error would normally indicate that the field name does not exist, e.g.
is misspelled. Or possibly you need to disambiguate the Field declaration, i.e.: Dim fld1 As DAO.Field Alternative syntax to try: inx.Fields.Append inx.CreateField("OpNoteID") -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Max" wrote in message ... Hi, I am using Access97 on Windows XP desktop and the following references: Visual basic VBA322.DLL Access 8.0 Object Library Common controls 6.0 Word 10.0 DAO 2.5/3.5 The following code generates a "Method or data member not found" error on the CreateField. Set tdf = dbs.TableDefs!Patients Set idx = tdf.CreateIndex("PatientIDIndex") Set fld1 = idx.CreateField("OpNoteID") Any ideas? Thanks in advance, Max |
#3
|
|||
|
|||
Hi Allen,
I used Dim fld1 As DAO.Field but still got the same error. The declarations a Dim dbsLogdat As Database, tdf As TableDef, idx As Index, fld1 As DAO.Field Max "Allen Browne" wrote in message ... The error would normally indicate that the field name does not exist, e.g. is misspelled. Or possibly you need to disambiguate the Field declaration, i.e.: Dim fld1 As DAO.Field Alternative syntax to try: inx.Fields.Append inx.CreateField("OpNoteID") -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Max" wrote in message ... Hi, I am using Access97 on Windows XP desktop and the following references: Visual basic VBA322.DLL Access 8.0 Object Library Common controls 6.0 Word 10.0 DAO 2.5/3.5 The following code generates a "Method or data member not found" error on the CreateField. Set tdf = dbs.TableDefs!Patients Set idx = tdf.CreateIndex("PatientIDIndex") Set fld1 = idx.CreateField("OpNoteID") Any ideas? Thanks in advance, Max |
#4
|
|||
|
|||
ADO and ADOX have an Index as well.
Try: Dim dbsLogdat As Database, tdf As DAO.TableDef, idx As DAO.Index, fld1 As DAO.Field -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Max" wrote in message ... Hi Allen, I used Dim fld1 As DAO.Field but still got the same error. The declarations a Dim dbsLogdat As Database, tdf As TableDef, idx As Index, fld1 As DAO.Field Max "Allen Browne" wrote in message ... The error would normally indicate that the field name does not exist, e.g. is misspelled. Or possibly you need to disambiguate the Field declaration, i.e.: Dim fld1 As DAO.Field Alternative syntax to try: inx.Fields.Append inx.CreateField("OpNoteID") "Max" wrote in message ... Hi, I am using Access97 on Windows XP desktop and the following references: Visual basic VBA322.DLL Access 8.0 Object Library Common controls 6.0 Word 10.0 DAO 2.5/3.5 The following code generates a "Method or data member not found" error on the CreateField. Set tdf = dbs.TableDefs!Patients Set idx = tdf.CreateIndex("PatientIDIndex") Set fld1 = idx.CreateField("OpNoteID") Any ideas? Thanks in advance, Max |
#5
|
|||
|
|||
Thanks Allen,
That helped with this bit code. Now other errors have come up that were not previously a problem. I suspect I have a references problem. Running through Doug Steele's very helpful pages. Max "Allen Browne" wrote in message ... ADO and ADOX have an Index as well. Try: Dim dbsLogdat As Database, tdf As DAO.TableDef, idx As DAO.Index, fld1 As DAO.Field -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Max" wrote in message ... Hi Allen, I used Dim fld1 As DAO.Field but still got the same error. The declarations a Dim dbsLogdat As Database, tdf As TableDef, idx As Index, fld1 As DAO.Field Max "Allen Browne" wrote in message ... The error would normally indicate that the field name does not exist, e.g. is misspelled. Or possibly you need to disambiguate the Field declaration, i.e.: Dim fld1 As DAO.Field Alternative syntax to try: inx.Fields.Append inx.CreateField("OpNoteID") "Max" wrote in message ... Hi, I am using Access97 on Windows XP desktop and the following references: Visual basic VBA322.DLL Access 8.0 Object Library Common controls 6.0 Word 10.0 DAO 2.5/3.5 The following code generates a "Method or data member not found" error on the CreateField. Set tdf = dbs.TableDefs!Patients Set idx = tdf.CreateIndex("PatientIDIndex") Set fld1 = idx.CreateField("OpNoteID") Any ideas? Thanks in advance, Max |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Strange error messages in reinstalled Office | Hans Näslund | General Discussions | 2 | September 22nd, 2004 08:32 PM |
Error message different in MDB and MDE | david epsom dot com dot au | General Discussion | 1 | September 21st, 2004 12:47 AM |
Error Message different in MDB and MDE | david epsom dot com dot au | General Discussion | 10 | September 15th, 2004 12:30 AM |
Help, i'm gettiing error: Access has encountered a problem and needs to close... | betsy | General Discussion | 0 | September 14th, 2004 08:20 PM |
Continual Error 1321 Trying to Install Office 2003 | Chad Harris | General Discussions | 9 | June 11th, 2004 08:19 AM |