M
mark r
i get an error message: method or data member not found:
Assessment is a combo box and field name in which the user is storing a
diagnosis test description.
maybe the problem is the AFTERupdate part of the code:
Private Sub Combo_assessmt_AfterUpdate()
Dim db As Database
Dim rs As DAO.Recordset
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT diagcode " & _
"FROM diagnosis " & _
"WHERE diagname = '" & Me!assessment & "'"
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
Me.assessment.Tag = Nz(rs!diagcode, "")
rs.Close
Set rs = Nothing
Set db = Nothing
Rem I am trying to store the diagnosis code associated with the diagnosis
name Rem in the tag value
End Sub
Private Sub Combo_assessmt_LostFocus()
If (Me.assessment.Tag = "36500") Then GoTo doMSG2027F
GoTo exitrout
doMSG2027F: MsgBox ("remember to .......")
GoTo exitrout
exitrout:
End Sub
There does exist a table that relates the assessment and the
diagcode :
Table Diagnosis:
diagcode text input mask 999.99
assessment text
category text
The source query does have both the assessment (or diagname) and the
diagcode available:
SELECT Diagnosis.diagname, Diagnosis_category, Diagnosis.code
FROM Tablecat_category INNER JOIN Diagnosis ON
Tablecat_category.category_code = Diagnosis.dg_category
ORDER BY Tablecat_category.category_number;
where Tablecat is yet another table of diagnosis categories
I am storing diagname in "assessment" but am looking to get diagcode into
the TAG value for each stored assessment so that I can run the appropriate
msgbox for particular diagcodes/diagnames
Would you suggest a different approach?
Assessment is a combo box and field name in which the user is storing a
diagnosis test description.
maybe the problem is the AFTERupdate part of the code:
Private Sub Combo_assessmt_AfterUpdate()
Dim db As Database
Dim rs As DAO.Recordset
Dim strSQL As String
Set db = CurrentDb
strSQL = "SELECT diagcode " & _
"FROM diagnosis " & _
"WHERE diagname = '" & Me!assessment & "'"
Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)
Me.assessment.Tag = Nz(rs!diagcode, "")
rs.Close
Set rs = Nothing
Set db = Nothing
Rem I am trying to store the diagnosis code associated with the diagnosis
name Rem in the tag value
End Sub
Private Sub Combo_assessmt_LostFocus()
If (Me.assessment.Tag = "36500") Then GoTo doMSG2027F
GoTo exitrout
doMSG2027F: MsgBox ("remember to .......")
GoTo exitrout
exitrout:
End Sub
There does exist a table that relates the assessment and the
diagcode :
Table Diagnosis:
diagcode text input mask 999.99
assessment text
category text
The source query does have both the assessment (or diagname) and the
diagcode available:
SELECT Diagnosis.diagname, Diagnosis_category, Diagnosis.code
FROM Tablecat_category INNER JOIN Diagnosis ON
Tablecat_category.category_code = Diagnosis.dg_category
ORDER BY Tablecat_category.category_number;
where Tablecat is yet another table of diagnosis categories
I am storing diagname in "assessment" but am looking to get diagcode into
the TAG value for each stored assessment so that I can run the appropriate
msgbox for particular diagcodes/diagnames
Would you suggest a different approach?