compile error using oldsoftbosses image sample

malum

Registered User.
Local time
Today, 16:18
Joined
Jul 21, 2003
Messages
11
I am using picture2k.zip which I have downloaded
see here by Oldsoftboss http://www.access-programmers.co.uk/forums/showthread.php?t=62251

I want to use it in another database that I have already set up but I can't get it to work. I get this:

compile error
user defined type not defined

It works fine on it's own but not as a separate form in the other database. (I eventually want to integrate the picture into the main database form but I need it to work first)


This
is the bit it brings up with Dim db As DAO.Database highlighted

Code:
Private Function GetPathPart() As String
    ' Comments  : Returns the path part of a string
    ' Parameters: strPath - string to parse
    ' Returns   : path part
    '
    Dim db As DAO.Database
    Dim strPath As String
    Dim intCounter As Integer
    
    Set db = CurrentDb
    strPath = db.Name
    db.Close
    Set db = Nothing
        

    For intCounter = Len(strPath) To 1 Step -1
        If Mid$(strPath, intCounter, 1) = "\" Then
            Exit For
        End If
    Next intCounter
    
    GetPathPart = Left$(strPath, intCounter)

I have imported the table and the form and when I type in the filename to display (in the form) it updates the table as it should


I should add that I know no VB at all (although I managed to change the relative path without a problem but checking out other posts here)

Any help appreciated.

If I don't answer for a while it's because my Mrs is due to give birth imminently. I will get back here when I can :D
 
Last edited:
Sorted

For some reason it worked if I created a new database and just exported all the tables and queries + the new image table into that but not if I exported to the old database.

Anyway I now have it in the main form and it works fine (in case anyone else comes across this problem)

My thanks to Oldsoftboss for the demo database

No baby yet either :)
 
You either:

1) had no "End Function" at the end of the function
2) your old database didn't have the correct reference

or
3) you just needed to compact and repair the database
 
modest said:
You either:

1) had no "End Function" at the end of the function
2) your old database didn't have the correct reference

or
3) you just needed to compact and repair the database

I tried 3 with no change

I dragged all the tables and forms to the new database and made no further changes and it worked fine. Very odd

thanks for taking the time to look :)
 
Well... all I can say is that copying into a new database rids a lot of errors. I used to experience some sort of error on close. I think it had to do with a bad index, or an unlisted object (who even knows anymore).

The only way that microsoft had to solve it was to copy into a new database.
 
modest said:
Well... all I can say is that copying into a new database rids a lot of errors. I used to experience some sort of error on close. I think it had to do with a bad index, or an unlisted object (who even knows anymore).

The only way that microsoft had to solve it was to copy into a new database.

I'm just glad it works now

Of course I would have been happier if it hadn't taken me half a day to think of creating a new database :eek:

I'll know next time
 

Users who are viewing this thread

Back
Top Bottom