New Access Install - Form no longer works- Help!!!

E

efandango

Can anybody help with this dire problem i have?

I have recently re-installed MS Access and now get the following errors when
I open my Main Form.

I haven’t changed any references to image paths or other associated files.


These are the messages I get when I first open the database.

'Project contains a missing or broken reference to the file
'AudioControls2.ocx' version 1.0'


'Project contains a missing or broken reference to the file
'AudioControls2.ocx' version 2.0'


These are the errors I get when I try to open the form, they appear in the
VBA debugger


'Compile Error:

Can't find project or library'

The debugger highlights the following code lines (see complete module code
detailed at bottom of this post):

(Public Function DisplayImage(ctlImageControl As Control, strImagePath As
Variant) As String
On Error GoTo Err_DisplayImage)

and

the word 'Left' in this line:

strDatabasePath = Left(strDatabasePath, intSlashLocation)


These are the errors I get when I try to close the Debugger

Undefined function 'Format' in expression
Undefined function 'Date' in expression
Undefined function 'Trim' in expression



This is the complete module code:

Public Function DisplayImage(ctlImageControl As Control, strImagePath As
Variant) As String
On Error GoTo Err_DisplayImage

Dim strResult As String
Dim strDatabasePath As String
Dim intSlashLocation As Integer

With ctlImageControl
If IsNull(strImagePath) Then
.Visible = False
strResult = "No image name specified."
Else
If InStr(1, strImagePath, "\") = 0 Then
' Path is relative
strDatabasePath = CurrentProject.FullName
intSlashLocation = InStrRev(strDatabasePath, "\",
Len(strDatabasePath))
strDatabasePath = Left(strDatabasePath, intSlashLocation)
strImagePath = strDatabasePath & strImagePath
End If
.Visible = True
.Picture = strImagePath
strResult = "Image found and displayed."
End If
End With

Exit_DisplayImage:
DisplayImage = strResult
Exit Function

Err_DisplayImage:
Select Case Err.Number
Case 2220 ' Can't find the picture.
ctlImageControl.Visible = False
strResult = "Can't find image in the specified name."
Resume Exit_DisplayImage:
Case Else ' Some other error.
MsgBox Err.Number & " " & Err.Description
strResult = "An error occurred displaying image."
Resume Exit_DisplayImage:
End Select
End Function
 
S

Stefan Hoffmann

hi,
Can anybody help with this dire problem i have?
I have recently re-installed MS Access and now get the following errors when
I open my Main Form.
I haven’t changed any references to image paths or other associated files.
'Project contains a missing or broken reference to the file
'AudioControls2.ocx' version 1.0'
Have you installed these components also? Have you checked the
references in the VBA IDE?


mfG
--> stefan <--
 
E

efandango

Fellas,

thanks for replying.

No, I havn't installed any components. I have never installed any components
(I don't know how to). I am a novice when it comes to Modules, VBA, etc. The
code in question was a cut n paste from somewhere, as part of an image
library mechanism.

what is the VBA IDE, is it the VBA envirnment that pops up when i want to
put some code onto a control?. If so, how do i check references?
 
S

Stefan Hoffmann

hi,
No, I havn't installed any components. I have never installed any components
(I don't know how to).
You wrote in you OP about a component:
This AudioControls2.ocx is a component not installed by Microsoft
Office. You need to install the software which provides this component.
This is not a Access issue.


mfG
--> stefan <--
 
E

efandango

Hello Stefan,

OK, I understand. Do you know how I can trace or track down the 'object' in
Access?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top