|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
I'm using (attempting to use) VBScript to pull up an Access Report from an Outlook form and I keep getting the following errors: 1. operation is not allowed when the object is open 2. database does not exist or else it is open excusivley to another user Error 2 occurs with the code below and I get error 1 when I remove strDBName. Can anyone please help me out? Thank you! Sub Get_Click() Dim objConnection Dim objAccess Dim strRptName Dim strDBName Dim objAddress Set objConnection = CreateObject("ADODB.Connection") objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=K:\PSHARE\Sourcing Department Structure\Procurement Services Project Database\1DepartmentData.mdb;" strDBName = objConnection.open strRptName = "rpt_Projects_Detail" Set objAccess = CreateObject("Access.Application") objAccess.Visible = False objAccess.OpenCurrentDatabase strDBName with objAddress.DoCmd .OpenReport strRptName, acViewPreview .Close end with objaccess.Quit acQuitSaveNone set objAccess = Nothing Set objConnection = Nothing end sub |
|
#2
|
|||
|
|||
|
Which Version of Access are you using
S-
__________________
If you have found a particular post helpful, show your appreciation by adding reputation points to that user by clicking the "scales" image in the upper right had corner of their post. |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Pulling an Access Report from an Outlook Form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|