G
Guest
I have code in a combobox AfterUpdate that I want to update a yes/no field if
the user enters certain values in the Diagnoses field. The problem I am
having is if the user makes a mistake and deletes the value He/She chose in
the combobox creating a null value, I get an error "Runtime error 94",
"Invalid use of Null".
I have tried several ways to fix this but none are working. The following is
the code:
Private Sub Diagnoses_AfterUpdate()
Dim stDiagnosesName As String
stDiagnosesName = [Diagnoses]
If stDiagnosesName = "Diabetes" Then
CronicCare = "Yes"
ElseIf stDiagnosesName = "Hypertension" Then
CronicCare = "Yes"
ElseIf stDiagnosesName = "Seizure Disorder" Then
CronicCare = "Yes"
ElseIf stDiagnosesName = "Asthma/COPD" Then
CronicCare = "Yes"
ElseIf stDiagnosesName = "Dialysis" Then
CronicCare = "Yes"
Else: CronicCare = "No"
End If
End Sub
How can I fix this problem?
Thanks,
Dennis
the user enters certain values in the Diagnoses field. The problem I am
having is if the user makes a mistake and deletes the value He/She chose in
the combobox creating a null value, I get an error "Runtime error 94",
"Invalid use of Null".
I have tried several ways to fix this but none are working. The following is
the code:
Private Sub Diagnoses_AfterUpdate()
Dim stDiagnosesName As String
stDiagnosesName = [Diagnoses]
If stDiagnosesName = "Diabetes" Then
CronicCare = "Yes"
ElseIf stDiagnosesName = "Hypertension" Then
CronicCare = "Yes"
ElseIf stDiagnosesName = "Seizure Disorder" Then
CronicCare = "Yes"
ElseIf stDiagnosesName = "Asthma/COPD" Then
CronicCare = "Yes"
ElseIf stDiagnosesName = "Dialysis" Then
CronicCare = "Yes"
Else: CronicCare = "No"
End If
End Sub
How can I fix this problem?
Thanks,
Dennis