Hello all,
I am pretty new to creating access forms and especially to data entry forms among multiple tables. Here is my situation:
- I have two tables, General and Company
- General has fields: ID, Program, CompanyID where ID is the primary key for the table.
- Company has fields: CompanyID, CompanyName where CompanyID is the primary key to the table.
As you can probably see, the General table only shows a companyID and the company table is the name of the company, so i have linked these tables on companyID. I now want a data entry form that will allow me to add a new program in the general table.
My record source for the form (this is where i think my error is) is
Code:
SELECT [General].[Program], [Company].[CompanyName] FROM [Company] INNER JOIN [General] ON [Company].[CompanyID] = [General].[CompanyID];
I have set the form data entry to yes and have two comboboxes on the form
- Program: RowSource - SELECT [General].[Program] FROM [General] GROUP BY [General].[Program] ORDER BY [General].[Program];
- Company: RowSource - SELECT [Company].[CompanyName] FROM [Company] GROUP BY [Company].[CompanyName] ORDER BY [Company].[CompanyName];
Other than the rowsource the comboboxes are exactly the same. When i show in form view i can see the programs in the dropdown for program, but i cannot choose one, it is like the combobox is locked, when it isn't. I can however, select a company name from the company dropdown box. When i remove the record source on the form they both work.
I am looking for a way to add a program in the general table, but i don't want to add the actual company name, i only want the CompanyID. I hope all of this makes sense, if not i can certainly give it another try. Thanks in advance for any assistance.