captain1974
Registered User.
- Local time
- Today, 19:31
- Joined
- Jan 15, 2007
- Messages
- 43
I'm getting error 3341 when trying to enter data into subforms.
I have set up a database with mulitple tables, these are the relevant ones:
tblVineyard
VineyardID
VineyardName
VineyardAddress
VineyardRegion
etc
tblBlock
BlockID
VineyardID
BlockName
Variety
etc
tblBlockHarvest
HarvestID
BlockID
tblSectionHarvest
SectionID
HarvestID
Date
Tonnage
etc
One vineyard can have many blocks, one block can have many harvests and each harvest can have many sections. I am confident that the relational side of things is all ok, I have built queries which are all returning the desired results.
The form I am setting up to allow data entry:
The main form contains the vineyard name, the next subform contains the BlockHarvest details & the next subform contains the SectionHarvest Details. I have set up a filter to select the vineyard at the top from a combobox, the 2 subforms then display the relevant data. (a list of harvests in datasheet view, if you click on a record within this list it displays info on the SectionHarvest subform). I have also setup the filter to list in a combobox only the fields that belong to the vineyard selected at the top. This combobox is placed into the BlockHarvest section, the trouble is I am getting error 3341 "The current field must match the join key '?' in the table that serves as the 'one' side of one-to-many relationship." whenever I try to add new data to the BlockHarvest subform.
I have tried stripping down the form to allow data entry of the blockIDs (which is how I have entered some of the data thus far directly into the table tblHarvestBlock) & I am actually getting the same error without any of the code to control filtering etc.
If I open the subform directly on it's own without opening the main form, it allows data entry but the filter is not applied to only list blocks from the relevant vineyard. (ie it is a long list and you do not know which vineyard the blocks are from).
I have also tried building the form from a query, however this will only create new vineyard records rather than select from a list.
Any help would be appreciated, I would actually be happy to have pop-ups to enter the data rather than the subforms, however I am having difficultly filtering these.
I have set up a database with mulitple tables, these are the relevant ones:
tblVineyard
VineyardID
VineyardName
VineyardAddress
VineyardRegion
etc
tblBlock
BlockID
VineyardID
BlockName
Variety
etc
tblBlockHarvest
HarvestID
BlockID
tblSectionHarvest
SectionID
HarvestID
Date
Tonnage
etc
One vineyard can have many blocks, one block can have many harvests and each harvest can have many sections. I am confident that the relational side of things is all ok, I have built queries which are all returning the desired results.
The form I am setting up to allow data entry:
The main form contains the vineyard name, the next subform contains the BlockHarvest details & the next subform contains the SectionHarvest Details. I have set up a filter to select the vineyard at the top from a combobox, the 2 subforms then display the relevant data. (a list of harvests in datasheet view, if you click on a record within this list it displays info on the SectionHarvest subform). I have also setup the filter to list in a combobox only the fields that belong to the vineyard selected at the top. This combobox is placed into the BlockHarvest section, the trouble is I am getting error 3341 "The current field must match the join key '?' in the table that serves as the 'one' side of one-to-many relationship." whenever I try to add new data to the BlockHarvest subform.
I have tried stripping down the form to allow data entry of the blockIDs (which is how I have entered some of the data thus far directly into the table tblHarvestBlock) & I am actually getting the same error without any of the code to control filtering etc.
If I open the subform directly on it's own without opening the main form, it allows data entry but the filter is not applied to only list blocks from the relevant vineyard. (ie it is a long list and you do not know which vineyard the blocks are from).
I have also tried building the form from a query, however this will only create new vineyard records rather than select from a list.
Any help would be appreciated, I would actually be happy to have pop-ups to enter the data rather than the subforms, however I am having difficultly filtering these.