Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compile error: methos or data member not found 2

Status
Not open for further replies.

mustangcoupe

Technical User
Feb 26, 2003
221
US
I downloaded this code off the web. it is part of some other code to embed files/objects into the table (images, fonts ect...)
It works fine! But when I make changes to the database on my acc 2003 machine and recompile it errors on fieldsize in this line ReDim bytBuffer(fldFieldName.FieldSize).

but in acc 2000 it works fine. any sugestions as I cant recompile my file or run it now. (Yes I do have a back up copy at home.)


Code:
Private Sub DownloadTableToFile(ByRef fldFieldName As Field, _
                                ByVal strFileName As String)
    Dim bytBuffer() As Byte
    Dim intFileNum  As Integer
    
    On Error GoTo ErrorHandler

    intFileNum = FreeFile
    
    Open strFileName For Binary As intFileNum
      
    ReDim bytBuffer(fldFieldName.FieldSize)
    bytBuffer = fldFieldName.GetChunk(0, fldFieldName.FieldSize)
    Put intFileNum, , bytBuffer()
       
ExitProcedure:
    On Error Resume Next
    Close intFileNum
    ReDim bytBuffer(0)
    Exit Sub
    
ErrorHandler:
    Select Case Err.Number
    
        Case 0
            ' Take action on known errors, or better yet fix them.
            Resume ExitProcedure
        
        Case Else
            MsgBox "Error in Sub DownloadTableToFile: " & CStr(Err.Number) & vbNewLine & _
                   Err.Description
            Resume ExitProcedure
        
    End Select
    
End Sub

--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
Hallo,

I don't know Acc 2003, but they've probably renamed the property.
In your code, delete .FieldSize and type a . after fldFieldName. Does it display a list of properties? If it does pick one which looks promising and do a help on it.

Alternatively just look up Field Properties in Help and find the one you want.

In Access '97 it was just called Size, maybe it's changed back?

- Frink
 
Thanks Frink

I have tried a few and it either errors out or makes it a line or two and errors again on something else.... This worked fine when I started to use it a month or so ago.
I added code to a part of a form but now my module dosent compile!


--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
Hallo,

In MS Access there are a number of different Field objects, depending on which librarys you use. This is all sorted out automatically and is fine until you start using different versions of MS Access.
I'm not totally sure of the score, but it might be that you are using a incompatible version of DAO.
Try changing
ByRef fldFieldName As Field
to
ByRef fldFieldName As DAO.Field
If that doesn't work, look at Tools->References (from a module)
There will be a Microsoft DAO entry ticked in the list.
Untick it and scroll down 'til you find one with a different version. Tick it, then close and recompile.
Try each version and see if one of them works.
It should be version 3.6 with Access 2000, I think.

- Frink

 
No reference issue ?
while in VBE, menu Tools -> References ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
No missing references, I am using....

VB for applications
access 11 object libary
active X 2.1 Libary
OLE Automation
OUTLOOK 11
DAO 3.6


--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
Hallo,

Try using Access 9 Object Library

- Frink
 
You may try this:
ByRef fldFieldName As DAO.Field

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
that is not in the list.

--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
that is not in the list
DAO.Field is not in the list ????

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
sorry PH, we posted at the same time.

I will try that

--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
It liked that.... Thanks Both of you.

--Todd


TechnicalUser pretending to be a programmer(shhh… the boss doesn’t know yet)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top