a problem while communicating whith ole server

A

andre ribas

hi everyone!
i get the following message:
A problem occurred while Microsoft Office Access was communicationg with OLE
server or ActiveX Control. Close the OLE server and restart it outside of
Microsoft Office Access. Then try the original operation again in Microsoft
Office Access.
this problem started when i wrote some code in an afterupdate of a field in
a subform. Its desperating, i even formated my computer and the problem is
still there.
To verify is the code is correct, i created a basic database whit the same
structure, and wrote the code in the same field, and all worked fine. So, i
was happy thinking that i coul import the original database to this one new,
and i did it... and the problem apeared again!!!!!

can u pleeeeaaase help me? im using office xp and the code is:

Option Compare Database

Private Sub alt_AfterUpdate()
If Forms![doentes]![sexo] = 1 And [alt] >= 0 And [alt] <= 41 Then
With CodeContextObject
.[grau ALT] = "normal"
End With
End If

If Forms![doentes]![sexo] = 1 And [alt] >= 42 And [alt] <= 82 Then
With CodeContextObject
.[grau ALT] = "grau 0"
End With
End If

If Forms![doentes]![sexo] = 1 And [alt] >= 83 And [alt] <= 144.5 Then
With CodeContextObject
.[grau ALT] = "grau 1"
End With
End If

If Forms![doentes]![sexo] = 1 And [alt] >= 144.5 And [alt] <= 289 Then
With CodeContextObject
.[grau ALT] = "grau 2"
End With
End If

If Forms![doentes]![sexo] = 1 And [alt] >= 290 And [alt] <= 578 Then
With CodeContextObject
.[grau ALT] = "grau 3"
End With
End If

If Forms![doentes]![sexo] = 1 And [alt] >= 579 Then
With CodeContextObject
.[grau ALT] = "grau 4"
End With
End If

If Forms![doentes]![sexo] = 0 And [alt] >= 0 And [alt] <= 31 Then
With CodeContextObject
.[grau ALT] = "normal"
End With
End If

If Forms![doentes]![sexo] = 0 And [alt] >= 32 And [alt] <= 62 Then
With CodeContextObject
.[grau ALT] = "grau 0"
End With
End If

If Forms![doentes]![sexo] = 0 And [alt] >= 62 And [alt] <= 108.5 Then
With CodeContextObject
.[grau ALT] = "grau 1"
End With
End If

If Forms![doentes]![sexo] = 0 And [alt] > 108.5 And [alt] <= 217 Then
With CodeContextObject
.[grau ALT] = "grau 2"
End With
End If

If Forms![doentes]![sexo] = 0 And [alt] > 217 And [alt] <= 434 Then
With CodeContextObject
.[grau ALT] = "grau 3"
End With
End If

If Forms![doentes]![sexo] = 0 And [alt] >= 434 Then
With CodeContextObject
.[grau ALT] = "grau 4"
End With
End If
End Sub
 

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