N
Neil
I have some code which has been in place for a while. Now, since I converted
to Access 2002/3 format, it doesn't work anymore. In the code, I set an
object variable of type Field to a particular field in the recordsetclone,
as follows:
Dim fld As Field
Set fld = Me.Recordsetclone.Fields(strField)
where strField is a string variable containing the name of the desired
field.
When this code is executed, I get a "type mismatch" error. Apparently it's
trying to use the value of the field, rather than the field itself.
I checked online help, and it says this:
"With the same syntax forms, you can also refer to the Value property of a
Field object that you create and append to a Fields collection. The context
of the field reference will determine whether you are referring to the Field
object or the Value property of the Field object."
So, according to this, since the context is that I am using "Set" to set an
object variable of type Field, one would think that it would return the
field itself, and not its value, and there would be no problem (as there
hasn't been in the past). But this is not the case.
Has anyone else encountered these problems? Any ideas about what to do here?
Unfortunately, while there is a Value property, there is no Field property
of the Fields collection, or else i'd use it. :-(
Thanks,
Neil
to Access 2002/3 format, it doesn't work anymore. In the code, I set an
object variable of type Field to a particular field in the recordsetclone,
as follows:
Dim fld As Field
Set fld = Me.Recordsetclone.Fields(strField)
where strField is a string variable containing the name of the desired
field.
When this code is executed, I get a "type mismatch" error. Apparently it's
trying to use the value of the field, rather than the field itself.
I checked online help, and it says this:
"With the same syntax forms, you can also refer to the Value property of a
Field object that you create and append to a Fields collection. The context
of the field reference will determine whether you are referring to the Field
object or the Value property of the Field object."
So, according to this, since the context is that I am using "Set" to set an
object variable of type Field, one would think that it would return the
field itself, and not its value, and there would be no problem (as there
hasn't been in the past). But this is not the case.
Has anyone else encountered these problems? Any ideas about what to do here?
Unfortunately, while there is a Value property, there is no Field property
of the Fields collection, or else i'd use it. :-(
Thanks,
Neil