You tried to use the code at
http://www.mvps.org/access/forms/frm0028.htm
without changing it to your actual setup? If yes, then it's no surprise that
it won't work.
Let's assume that your "program name" combo box is named cboPrograms. Its
Row Source should be a query similar to this:
SELECT DISTINCT Table1.ProgramID, Table1.ProgramNames FROM Table1;
Its Bound Column should be column 1.
Then let's assume that your second combo box, the one that will show the
charge codes, is named cboCharges. Its RowSource should be empty initially,
as the code that runs on the cboPrograms combo box's AfterUpdate event will
handle that:
Private Sub cboPrograms_AfterUpdate()
Dim strSQL As String
strSQL = "Select ChargeCodes FROM Table2 "
strSQL = strSQL & "WHERE ProgramID=" & Me.cboPrograms
Me!cbxCombo2.RowSourceType = "Table/Query"
Me!cbxCombo2.RowSource = strSQL
End Sub