Method or Data member not found

  • Thread starter Thread starter LisaB
  • Start date Start date
L

LisaB

Can anyone tell me why I get a compile error: Method or data member not found when I try to compile the following code?

This code works in Access 97. I am now using Access 2000
The compile error is on ==> fld.CreateProperty and on ==> fld.Properties.Append Prop
---------------------------------------------------
For Each fld In TheTable.Fields
If fld.Type = dbBoolean Then
' MsgBox fld.Name

' 106 is CheckBox, 109 is TextBox, 111 is ComboBox
Set prop = fld.CreateProperty("DisplayControl", dbLong, 106)
fld.Properties.Append prop
End If
Next fld
 
ACCESS 2000 (and 2002) does not have a default reference to the DAO library,
which is the library that contains the Field object. Instead, this version
has a default reference to ADO library.

Open the VBE, click on Tools | References, and select the DAO library from
the list (Data Access Object library). Close the window.

Then, it's highly recommended that you disambiguate references by using the
DAO object in your declarations:

Dim fld As DAO.Field

If you won't use ADO, it's a good idea to deselect it from the References.
\
--

Ken Snell
<MS ACCESS MVP>

Can anyone tell me why I get a compile error: Method or data member not
found when I try to compile the following code?

This code works in Access 97. I am now using Access 2000
The compile error is on ==> fld.CreateProperty and on ==>
fld.Properties.Append Prop
---------------------------------------------------
For Each fld In TheTable.Fields
If fld.Type = dbBoolean Then
' MsgBox fld.Name

' 106 is CheckBox, 109 is TextBox, 111 is ComboBox
Set prop = fld.CreateProperty("DisplayControl", dbLong, 106)
fld.Properties.Append prop
End If
Next fld
 
Back
Top