A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

CreateField error



 
 
Thread Tools Display Modes
  #1  
Old October 20th, 2004, 06:15 PM
Max
external usenet poster
 
Posts: n/a
Default 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  
Old October 21st, 2004, 07:31 AM
Allen Browne
external usenet poster
 
Posts: n/a
Default

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  
Old October 21st, 2004, 11:13 AM
Max
external usenet poster
 
Posts: n/a
Default

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  
Old October 21st, 2004, 01:00 PM
Allen Browne
external usenet poster
 
Posts: n/a
Default

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  
Old October 21st, 2004, 06:56 PM
Max
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 12:07 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.