Re: Member or Data Member not Found

Tech-Archive recommends: Speed Up your PC by fixing your registry



Allen;
Thanks for assisting me!

Management made us reinstall Access 2000, just too many problems
upgrading! The DAO 3.6 is the Reference being used.

I am trying to isolate the problem, but I am having trouble
understanding why it fails so differently going from computer to computer.

I included the update of where I am at this minute.

Now I get invalid or unqualified Reference on the .TableDef below!

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim tdf As DAO.TableDef
Dim fld As Field

Set db = CurrentDb

Set rst = db.OpenRecordset("SELECT * FROM HrsRate")

For Each tdf In .TableDef




Next tdf

Any more ideas? And, thanks for the help!

"Allen Browne" wrote:

Choose References from the Tools menu. You already have a reference to the
DAO library (else the code would fail on the first line), but check that it
is DAO 3.6. Referencing an old 2.5/3.5 compatibility library sometimes
worked in 2000 and failed on update to A2002.

It could also be a Name AutoCorrect error. Make sure these check boxes are
unchecked under:
Tools | Options | General
For an explanation of why:
http://allenbrowne.com/bug-03.html

Whether or not you reset the Name AutoCorrupt boxes, compact/repair the
database:
Tools | Database Utilities

If the issue remains, we need to determine whether the failure is tdf.Name
or the call to Left() - possibly a naming clash. To determine this, try:
Debug.Print tdf.Name
or replace the line with:
If tdf.Name Like "AlphaErrors*"

--
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.

"Bill Barber" <BillBarber@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:BC2E11CD-278F-4656-832F-4E79F5F7AE92@xxxxxxxxxxxxxxxx
I updated from Access 2000 to 2002 and now I get this error on something
that
has been working for years.

Here is the code!

Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim tdf As TableDefs

Set db = CurrentDb

Set rst = db.OpenRecordset("SELECT * FROM AlphaErrors")

With db
For Each tdf In .TableDefs
If Left(tdf.Name, 11) = "AlphaErrors" Then ' Error
Here Member or Data Member not Found On tdf.Name!
MsgBox "Found Error Table"
End If
Next tdf
End With

Does anyone know what I have to change to get this to work?

Thanks a Lot

Bill



.



Relevant Pages

  • Re: Bells & Whistles
    ... I think they both use the same library reference for DAO. ... "wallymeister" wrote in message ... it could be that you are lacking a reference to the Microsoft ... > Dim bLabelVisible As Boolean ...
    (microsoft.public.access.formscoding)
  • Re: Search form with multiple controls
    ... Database is an object in the DAO object model. ... Access 2000 and 2002 don't set that reference). ... Change the declaration from Dim rst as Recordset to Dim rst as DAO.Recordset ...
    (microsoft.public.access.forms)
  • Re: Switchboard question
    ... Access 2000 and 2002 set a reference to the ADO library. ... Scroll down to you get to Microsoft DAO 3.xx and check it. ... Dim dbs As DAO.Database ... Dim rst As DAO.Recordset ...
    (microsoft.public.access.formscoding)
  • Re: storing SQL result into a VB variable?
    ... as I said earlier you can do this using either ADO or DAO. ... you'll need a reference to the Microsoft ActiveX Data Objects ... Dim rst As DAO.Recordset ... Set rst = db.OpenRecordset("SELECT YourField FROM YourTable WHERE ...
    (microsoft.public.access.modulesdaovba)
  • Re: VBA error calling parameter query
    ... DAO, so your code would work fine there. ... usually have a reference set to ADO as well as to DAO, ... Dim rst As DAO.Recordset ...
    (microsoft.public.access.formscoding)