Method or data member not found..

Lifeseeker

Registered User.
Local time
Today, 15:44
Joined
Mar 18, 2011
Messages
273
Hi there,

I have few lines of VBA code in access 2007, but it is not working as I keep getting "method or data member not found error whenever a field gets updated.

logic is: If the initial lactate by method 2 is < 4 then use the initial lactate by method 1 to risk stratify.

If the initial lactate by method 2 is >=4, use THIS method to risk stratify.

But it is not working....

Could anybody please help?

PLease see the attached file.

Thank you
 

Attachments

Can you paste the code?

Code:
Private Sub Initial_Lactate_Result_Method_One_AfterUpdate()
If Me.Initial_Lactate_Result_Method_two < 4 Then
If Me.Initial_Lactate_Result_Method_One >= 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 3
End If
If Me.Initial_Lactate_Result_Method_One >= 4 And Me.BP >= 90 Then
Me.Risk_Level.Value = 2
End If
If Me.Initial_Lactate_Result_Method_One < 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 1
End If
If Me.Initial_Lactate_Result_Method_One < 4 And Me.BP >= 90 And Me.Admission_Flag.Value = 1 Then
Me.Risk_Level.Value = 4
End If
If Me.Initial_Lactate_Result_Method_One = "" Or Me.BP = "" Then
Me.Risk_Level.Value = 5
End If
End If
If Me.Initial_Lactate_Result_Method_two >= 4 Then
If Me.Initial_Lactate_Result_Method_two >= 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 3
End If
If Me.Initial_Lactate_Result_Method_two >= 4 And Me.BP >= 90 Then
Me.Risk_Level.Value = 2
End If
If Me.Initial_Lactate_Result_Method_two < 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 1
End If
If Me.Initial_Lactate_Result_Method_two < 4 And Me.BP >= 90 And Me.Admission_Flag.Value = 1 Then
Me.Risk_Level.Value = 4
End If
If Me.Initial_Lactate_method_two.Value = "" Or Me.BP.Value = "" Then
Me.Risk_Level.Value = 5
End If
End If
End Sub
 
Private Sub Initial_Lactate_Result_Method_two_AfterUpdate()
If Me.Initial_Lactate_Result_Method_two < 4 Then
If Me.Initial_Lactate_Result_Method_One >= 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 3
End If
If Me.Initial_Lactate_Result_Method_One >= 4 And Me.BP >= 90 Then
Me.Risk_Level.Value = 2
End If
If Me.Initial_Lactate_Result_Method_One < 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 1
End If
If Me.Initial_Lactate_Result_Method_One < 4 And Me.BP >= 90 And Me.Admission_Flag.Value = 1 Then
Me.Risk_Level.Value = 4
End If
If Me.Initial_Lactate_Result_Method_One = "" Or Me.BP = "" Then
Me.Risk_Level.Value = 5
End If
End If
If Me.Initial_Lactate_Result_Method_two >= 4 Then
If Me.Initial_Lactate_Result_Method_two >= 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 3
End If
If Me.Initial_Lactate_Result_Method_two >= 4 And Me.BP >= 90 Then
Me.Risk_Level.Value = 2
End If
If Me.Initial_Lactate_Result_Method_two < 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 1
End If
If Me.Initial_Lactate_Result_Method_two < 4 And Me.BP >= 90 And Me.Admission_Flag.Value = 1 Then
Me.Risk_Level.Value = 4
End If
If Me.Initial_Lactate_method_two.Value = "" Or Me.BP.Value = "" Then
Me.Risk_Level.Value = 5
End If
End If
End Sub

Private Sub systolic_pressure_AfterUpdate()
If Me.Initial_Lactate_Result_Method_two < 4 Then
If Me.Initial_Lactate_Result_Method_One >= 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 3
End If
If Me.Initial_Lactate_Result_Method_One >= 4 And Me.BP >= 90 Then
Me.Risk_Level.Value = 2
End If
If Me.Initial_Lactate_Result_Method_One < 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 1
End If
If Me.Initial_Lactate_Result_Method_One < 4 And Me.BP >= 90 And Me.Admission_Flag.Value = 1 Then
Me.Risk_Level.Value = 4
End If
If Me.Initial_Lactate_Result_Method_One = "" Or Me.BP = "" Then
Me.Risk_Level.Value = 5
End If
End If
If Me.Initial_Lactate_Result_Method_two >= 4 Then
If Me.Initial_Lactate_Result_Method_two >= 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 3
End If
If Me.Initial_Lactate_Result_Method_two >= 4 And Me.BP >= 90 Then
Me.Risk_Level.Value = 2
End If
If Me.Initial_Lactate_Result_Method_two < 4 And Me.BP < 90 Then
Me.Risk_Level.Value = 1
End If
If Me.Initial_Lactate_Result_Method_two < 4 And Me.BP >= 90 And Me.Admission_Flag.Value = 1 Then
Me.Risk_Level.Value = 4
End If
If Me.Initial_Lactate_method_two.Value = "" Or Me.BP.Value = "" Then
Me.Risk_Level.Value = 5
End If
End If
End Sub

I have put the checks in three fields as the decision rules apply to all of them.

Thank you
 
Hello,

can anyone help? I am stuck. The code is in Initial_Lactate_Result_Method_two_AfterUpdate()

The logic is if the initial lactate by the 2nd method is >=4, then use this lactate to risk stratify.

However, if the initial lactate by the 1st method is >=4, use this first method to risk stratify.

When you put value of >=4 in "initial_lactate_result_method_2" field, I get a error saying data member or method not found.

By risk stratify, I mean I want Access to assign risk levels as seen in "Risk_level" field. Exactly how to assign risk levels are rules based on guidelines, which are not to be changed, but I am struggling letting Access choose which lactate level to use to risk stratify.

code highlighted is:
Code:
If Me.Initial_Lactate_Result_Method_One >= 4

Could anybody point me in the right direction?

Thank you
 

Attachments

it is hard to follow all these nested choices, but i presume one of your values does not exist, or is mistyped

there are a couple of issues i can see

in one case you test bp as = "", and in others set it to a numeric. one or other of these will generate an error

you do not need the qualifier .value - i am not sure whether it is just unnecessary, or whether it is an error

it may be that the code is looking for form controls with these names, rather than field names - in which case that might be the problem. without testing, i am not 100% sure how the me. gets resolved.
 

Users who are viewing this thread

Back
Top Bottom