Re: Member or Data Member not Found



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: Member or Data Member not Found
    ... you've removed the reference to ADO. ... your declaration for tdf is incorrect. ... 2002 only references ADO, but you can add a reference to DAO. ... You must disambiguate as Dim rst As DAO.Recordset. ...
    (microsoft.public.access.formscoding)
  • Re: Code doesnt work on some computers
    ... suspect is a references problem. ... ' This section Creates the database. ... Dim wrkDefault As Workspace ... Set qdfPassthrough = CurrentDb.QueryDefs ...
    (microsoft.public.access.modulesdaovba)
  • Re: Export a reprot to Excel
    ... 'you can choose which worksheet will receive the data ... Dim objXLApp As Object 'Excel.Application ... Dim rst As DAO.Recordset ... 'replace with names and cell references that suit your template ...
    (microsoft.public.access.reports)
  • Re: Sending Word 2007 data to Excel 2007
    ... in the first row of the first sheet, you have inserted the names of the ... Microsoft Excel 12.0 Object Library ... Dim PathToUse As String ... are there any references on how to somehow "publish" the ...
    (microsoft.public.word.vba.general)
  • RE: "Cant find project or library" after emailing files.
    ... Open the 'problem' workbook. ... NAME and GUID for each of the references shown when you ran ... Dim aryHiddensheets() ... ' 'Microsoft ActiveX Data Objects Recordset 2.5 Library ...
    (microsoft.public.excel.misc)