Urgent! Error "Run time error: Disconnected from client"

  • Thread starter Thread starter Christine
  • Start date Start date
C

Christine

I am an inexperienced user and in urgent help to get a
project done this weekend.

From an Access site (can't remember which), I found a
calendar program created by byerley.net and put in onto
my system at work, where it worked fine, so I copied the
code into my Access form, where it again worked fine. I
copied everything to my home PC so work on it this
weekend, but neither his program (AccessCalDemo) nor mine
works anymore. I get the following error:

"Run Time Error (-2147417878 (80010108) Automatation
Error. The object has been disconnected from its client"

The system then asks if I want to send an error report.
It shuts Access down completely whether I click no or yes.
My PC at work and at home are running Windows XP with
Access 2002.

I could see his code not working in my programme anymore
if I accidently did something wrong, but even original
programme doesn't work anymore. Please HELP!!

Ta, Christine
 
Hi Christine,

On the computer where it fails open the database file and open a module (or
create one if none exists). Select the menu option Tools > References,
check the library references.

Most likely you have a library reference that shows as MISSING (there's
your problem).

The cause is probably whatever ActiveX Control (OCX control) you use in the
database file is not properly registered on this machine like the others.

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.


Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."


--------------------
| Content-Class: urn:content-classes:message
| From: "Christine" <[email protected]>
| Sender: "Christine" <[email protected]>
| Subject: Urgent! Error "Run time error: Disconnected from client"
| Date: Sat, 6 Mar 2004 06:02:05 -0800
| Lines: 24
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcQDg5tNUK5ew3ZXSLKVpATz+JQiqQ==
| Newsgroups: microsoft.public.access.formscoding
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.access.formscoding:223604
| NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
| X-Tomcat-NG: microsoft.public.access.formscoding
|
| I am an inexperienced user and in urgent help to get a
| project done this weekend.
|
| From an Access site (can't remember which), I found a
| calendar program created by byerley.net and put in onto
| my system at work, where it worked fine, so I copied the
| code into my Access form, where it again worked fine. I
| copied everything to my home PC so work on it this
| weekend, but neither his program (AccessCalDemo) nor mine
| works anymore. I get the following error:
|
| "Run Time Error (-2147417878 (80010108) Automatation
| Error. The object has been disconnected from its client"
|
| The system then asks if I want to send an error report.
| It shuts Access down completely whether I click no or yes.
| My PC at work and at home are running Windows XP with
| Access 2002.
|
| I could see his code not working in my programme anymore
| if I accidently did something wrong, but even original
| programme doesn't work anymore. Please HELP!!
|
| Ta, Christine
|
 
Eric,

The programme code from byerley.net does not have any
modules. Since the program calls up what looks like the
standard calendar, I checked for a calendar and it
appears in the list of Available Controls.

Here's the code in the form where the calendar is called:

Private Sub ActivateCalendarForm(ByVal sCtrl As String)
'*****************************************************
' This Sub "ActivateCalendar" and Function "IsSubForm"
' is the Code that calls the Calendar Form.
' You can put this in any form module where you want to
' call the calendar or put it in a Standard Module and
' make it "Public Sub ActivateCalendarForm(ByRef sCtrl As
String)
' and "Public Function IsSubForm(fForm As Form) As
Boolean"
'*******************************************************
Dim sArgs As String
Dim sFullFormName As String
If IsSubForm(Me) = True Then
sFullFormName = "SubForm" & "*" & Me.Parent.Name
Else
sFullFormName = "Form" & "*" & Me.Name
End If
sArgs = sFullFormName & "|" & sCtrl
DoCmd.OpenForm "frmCalendar", , , ,
acFormPropertySettings, acDialog, sArgs
End Sub

Private Function IsSubForm(fForm As Form) As Boolean
On Error GoTo HandleErr
If IsObject(fForm.Parent) Then
IsSubForm = True 'The Form Passed is a Subform
Else
IsSubForm = False 'The Form Passed is a Mainform
End If

Exit Function
HandleErr:
IsSubForm = False
End Function

Private Sub Command1_Click()
'*****************************************************
' This is the Code that is passed to the Calendar Form.
' A Reference to the "Name" of the Control to be Updated
' is passed as an argument to the Sub
ActivateCalendarForm.
' You would replicate this code in whatever event you
' would use it in, changing the control Name to be updated
' in the Argument. In this Sub, the control name
is "Text1"
'*****************************************************
ActivateCalendarForm "Text1"
End Sub

Private Sub Text1_DblClick(Cancel As Integer)
ActivateCalendarForm "Text1"
End Sub

Private Sub Text2_DblClick(Cancel As Integer)
ActivateCalendarForm "Text2"
End Sub

Here's the code that is in frmCalendar:


Option Compare Database
Dim arArgs() As String

Private Sub cal1_Click()
UpdateCaller cal1.Value
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

Private Sub Form_Activate()

Form_Resize
End Sub

Private Sub Form_Load()
If Me.OpenArgs = "" Or IsNull(Me.OpenArgs) = True Then
MsgBox "This Calendar Form is not designed to be
Opened" & vbCrLf & _
"EXCEPT when Called from an Event in another
Form." & vbCrLf & _
"It will Display, but no further Code will
execute...", vbOKOnly + vbInformation, "Improper Use of
Calendar"
Exit Sub
End If
Form_Resize

'Me.OpenArgs contains Whether the form is Main or
SubForm, and
'the name of the TextBox to be updated from the
Calendar Selection.

arArgs = Split(Me.OpenArgs, "|")
If Me.OpenArgs <> "" Then
arArgs = Split(Me.OpenArgs, "|")
With Me.cal1
.Month = Month(Date)
.Day = Day(Date)
.Year = Year(Date)
End With
End If
End Sub

Private Sub Form_Resize()
With Me
.InsideHeight = 3600
.InsideWidth = 3600
.Detail.Height = 3600
End With
With cal1
.Top = 0
.Left = 0
.Height = 3600
.Width = 3600
End With
End Sub

Private Sub UpdateCaller(ByVal DateIn As Date)
Dim fFrm As Form
Dim cCtrl As Control
Dim arFormInfo() As String

arFormInfo = Split(arArgs(0), "*")

For Each fFrm In Forms
If fFrm.Name = arFormInfo(1) Then
If LCase(arFormInfo(0)) = "subform" Then
Set cCtrl = fFrm.ActiveControl.Form.Controls
(arArgs(1))
cCtrl.Value = DateIn
Else
Set cCtrl = fFrm.Controls(arArgs(1))
cCtrl.Value = DateIn
End If
Exit For
End If
Next fFrm
End Sub

I really liked Byerley's code since, as a Newbie, it
isn't as complicated as some of the other Calendar code
I've seen and it had been working really well! I simply
changed "Text1" and "Text2" to match my form fields.

Your help soonest will be really appreciated!

Christine
 
Back
Top