I am using Access 2007.
I am trying to have the values displayed in field DiagnosticType (combobox) driven by what has been selected in the field DiagnosticTool (also a combobox). I have found suggestions on how to accomplish this in various places and as far as I can tell have set it up correctly. But something is still not right because it doesn't work. Maybe another set of eyes will help me see what I have missed.
Here is the select stmt on the DiagnosticType field:
And I put this in the VBA:
My tables are:
DiagnosticTools
ID DiagnosticTool
1 Surgery
2 Needle Biopsy
DiagnosticType
ID Type
1 Lumpectomy
2 CT
DiagTypeToolsXref
ID DiagTypeID DiagToolID
1 1 1
2 2 2
So if the user selects Surgery as the Diagnostic Tool they should only see Lumpectomy in the Diagnostic Type field.
I hope I have given enough information. I look forward to being shown what I have done wrong.
TIA!
~RLG
I am trying to have the values displayed in field DiagnosticType (combobox) driven by what has been selected in the field DiagnosticTool (also a combobox). I have found suggestions on how to accomplish this in various places and as far as I can tell have set it up correctly. But something is still not right because it doesn't work. Maybe another set of eyes will help me see what I have missed.
Here is the select stmt on the DiagnosticType field:
Code:
SELECT DiagnosticType.ID, DiagnosticType.Type
FROM (DiagnosticTools
INNER JOIN DiagTypeToolsXref
ON DiagnosticTools.ID = DiagTypeToolsXref.DiagToolID)
INNER JOIN DiagnosticType
ON DiagTypeToolsXref.DiagTypeID = DiagnosticType.ID
WHERE (((DiagTypeToolsXref.DiagToolID)=[forms]![sfrmDiagBreast]![DiagnosticTools].[ID]))
ORDER BY DiagnosticType.Type;
And I put this in the VBA:
Code:
Private Sub DiagnosticTool_AfterUpdate()
Me.DiagnosticType.Requery
Me.DiagnosticType.SetFocus
Me.DiagnosticType.Dropdown
End Sub
Private Sub DiagnosticTool_GotFocus()
Me.DiagnosticType = Null
End Sub
My tables are:
DiagnosticTools
ID DiagnosticTool
1 Surgery
2 Needle Biopsy
DiagnosticType
ID Type
1 Lumpectomy
2 CT
DiagTypeToolsXref
ID DiagTypeID DiagToolID
1 1 1
2 2 2
So if the user selects Surgery as the Diagnostic Tool they should only see Lumpectomy in the Diagnostic Type field.
I hope I have given enough information. I look forward to being shown what I have done wrong.
TIA!
~RLG