I know this has been discussed here a million times before and I have searched but I cannot find an answer that fits my situation. I looked for both Type Mismatch and One Combobox based on another.
I have two ComboBoxes on my form and I am trying to have the list in one based on the results in another. The two comboboxes are Event and Position, the idea being when I select an Event in the Event combobox the Positions available to choose from in the Positions combobox will be based on the Employer for that Event.
The form is a Calls (as in work calls) Form (frmCallss) that has an Events Combobox (cboEvents) that has five columns associated with it, the last being EmployerFK. I also have a Positions Combobox (cboPositions) that has 4 columns associated with it once again the last being EmployerFK.
The Events Combobox uses an Events Table (tblEvents) as the basis for its RowSource (I am using a select query) and the Positions Combobox uses a Positions Table as the basis for its Rowsource (once again I am using a select query).
I have not forgotten that when referring to the columns in the Combobox query the columns are numbered with a base 0. (The last column of 5 is number 4)
This is the SQL statement I am using in the Positions Combobox Rowsource:
SELECT tblPositions.PositionID, tblPositions.Department, tblPositions.Position, tblPositions.EmployerFK
FROM tblPositions
WHERE (((tblPositions.EmployerFK)="&[Forms]![frmCalls]![cboEvents.Column(4)&"));
This select query is in the Criteria field of the EmployerFK column (the last column - Column 5, referred to as 4) of the Query builder.
I have set the Data Type of EmployerFK in both tables to Number (Long Integer).
When I click on the Positions Combobox Access comes up with the Type Mismatch error. Why?
TIA
John V