I am sure that this is a simple problem to anyone with some experience but it has got me stumped.
I have 2 tables "Animal_Data" and "Species_Data".
Animal_Data has fields: "TxtCommonNameOnAnimalData", TxtLatinName, TxtCITESStatus and TxtAnimalClass.
The information to fill these fields is held in "Species_Data" in fields: TxtCommonNameOnSpecies, TxtScientificName, TxtCITESAppendix and TxtAnimalClass.
All fields are text and are set as short text.
Data is entered by users into table Animal_Data via form FrmNewAnimal
On FrmNewAnimal the user selects the common name by using a ComboBox (Combo88) which looks up the common name from field TxtCommonNameOnSpecies in the Species_Data table and then saves it to TxtCommonNameOnAnimalData in the Animal_Data table.
When a user has selected the common name of an animal then I would like to form to autopopulate the text boxes for latin name, CITES appendix and Animal Class on FrmNewAnimal by looking up the values from table Species_Data. These values would then be saved when the record is saved.
I thought that DLookup would be a good solution to this, using the selected Common Name in Combo88 on FrmNewAnimal as the reference and then matching latin name, class and CITES status from the Species_Data table into different text boxes also on frmNewAnimal.
I cannot get this to work though and have been trying different configurations in the Data.
So my questions would be:
1. Is this the best way to achieve this?
2. If yes, then how do I get it to do it.
At the moment I have a text box which I want to autopopulate with the latin (scientific) name. I have the control source set to:
=DLookUp([Species_Data]![TxtScientificName],[Species_Data],"[Species_Data]![TxtCommonNameOnSpecies]= " & [Forms]![FrmNewAnimal]![Combo88])
but this returns a #Name? error. I have tried various combinations, including shortened versions of referencing expression and domain, and these either return the same name error or just #Error. If I just set the Expression and domain then it finds the first latin name on the list so seems to look in the right place but my criteria is wrong somehow.
I am sure this is just me doing something silly and any help and advice would be really appreciated.
Thanks.
I have 2 tables "Animal_Data" and "Species_Data".
Animal_Data has fields: "TxtCommonNameOnAnimalData", TxtLatinName, TxtCITESStatus and TxtAnimalClass.
The information to fill these fields is held in "Species_Data" in fields: TxtCommonNameOnSpecies, TxtScientificName, TxtCITESAppendix and TxtAnimalClass.
All fields are text and are set as short text.
Data is entered by users into table Animal_Data via form FrmNewAnimal
On FrmNewAnimal the user selects the common name by using a ComboBox (Combo88) which looks up the common name from field TxtCommonNameOnSpecies in the Species_Data table and then saves it to TxtCommonNameOnAnimalData in the Animal_Data table.
When a user has selected the common name of an animal then I would like to form to autopopulate the text boxes for latin name, CITES appendix and Animal Class on FrmNewAnimal by looking up the values from table Species_Data. These values would then be saved when the record is saved.
I thought that DLookup would be a good solution to this, using the selected Common Name in Combo88 on FrmNewAnimal as the reference and then matching latin name, class and CITES status from the Species_Data table into different text boxes also on frmNewAnimal.
I cannot get this to work though and have been trying different configurations in the Data.
So my questions would be:
1. Is this the best way to achieve this?
2. If yes, then how do I get it to do it.
At the moment I have a text box which I want to autopopulate with the latin (scientific) name. I have the control source set to:
=DLookUp([Species_Data]![TxtScientificName],[Species_Data],"[Species_Data]![TxtCommonNameOnSpecies]= " & [Forms]![FrmNewAnimal]![Combo88])
but this returns a #Name? error. I have tried various combinations, including shortened versions of referencing expression and domain, and these either return the same name error or just #Error. If I just set the Expression and domain then it finds the first latin name on the list so seems to look in the right place but my criteria is wrong somehow.
I am sure this is just me doing something silly and any help and advice would be really appreciated.
Thanks.