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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opencurrentdatabase not working

Status
Not open for further replies.

moonbase

Programmer
Nov 18, 2002
57
GB
I have an Access application that opens a second access database using opencurrentdatabase and opens a form and does some other stuff.

This has been working fine locally (access 2002) and on the network (access 2003, upgraded from 2002). The application is in 2002.

There is a new termianl on the network with a fresh install of access 2003 and opencurrentdatabase isn't working. I now get a 'Object variable or With block variable not set' error. It looks like there's something missing, but what?

Thanks
 
Hi

Here is the relevant code.

' for letters
Dim appAccess As Access.Application

' letter: open mdb

Private Function LetterOpenApp() As Boolean

On Error GoTo LetterOpenApp_Error
LetterOpenApp = True

Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase Application.CurrentProject.Path & "\promacc_letter.mdb"
appAccess.Visible = True
appAccess.DoCmd.RunCommand acCmdAppMaximize

Exit Function

LetterOpenApp_Error:
MsgBox "The promacc letter module is not installed.", vbExclamation + vbOKOnly, "promacc"
LetterOpenApp = False

End Function

Thanks
 

If this code is working at all other locations, the first thing I'd do is to check for MISSING references.


Randy
 
That's an idea, I'll check this next time I'm on site. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top