Rain, thanks for your new instructions. I tried to follow them, but I’m not sure I did correctly.
I started with my original table, called AgencyProgram, which has three fields: ID, AgencyName and ProgramName. I used Analyze to create three individual tables. The main table is tblAgyPgmLookup, which has three fields, an ID number, Lookup_to_tblPrgm, and Lookup_to_tblAgcy. The two lookup fields that Access created weren’t numeric, they were text: the agency and program names. The other two tables are tblAgcy and tblPrgm. I went ahead anyway, and bound the form to tblAgyPgmLookup.
For the first combo box (cboEditAgency), I had three choices as a control source: ID, tblAgcy_ID and tblPrgm_ID. I chose tblAgcy_ID. Then as a row source I chose the AgencyName field from tblAgcy. I tried it and it worked.
Then I did the second combo box(cboEditPgm). I chose tblPrgm_ID. As the row source. I had to create a query since I need the second box to filter records based on the first. This is the query:
SELECT tblPrgm.ProgramName FROM tblAgcy INNER JOIN tblPrgm ON tblAgcy.ID=tblPrgm.ID WHERE (((tblAgcy.AgencyName)=Forms!frmEditAgys!cboEditAgy)) GROUP BY tblPrgm.ProgramName ORDER BY tblPrgm.ProgramName;
When I tried it, I got this message for the first combo box, “The value you entered isn’t valid for this field. For example, you may have entered text in a numeric field or a number that is larger than the field size setting permits.” I got the same error message for the second box. What did I do wrong?
Before I got your last post, I tried it with a query, which you suggested was the way you prefer, and had better success, but in the end there was a different problem. I started with the original table, AgencyProgram, and used Analyze to create two tables, tblAgy and tblPgm: tbl Pgm has a lookup to tblAgy. Then I created a query with AgencyName from tblAgy and ProgramName from tblPgm. I bound the form to the query, and that allowed me to have AgencyName from the query as a control source for the first box and Program Name for the second one. I used the tables as row sources and created a query for the second box to filter records by the contents of the first one. It worked. The problem is that I seem to be able to add records to the tables, but not to edit or delete them: any change I make results in a new record.
Which is the best way to go, and what's the next step?
Many thanks,
Henry