1) tbl_Survey (frm_Survey, page 1 of a tab control) has Survey_ID primary key and field Survey_Num
2) tbl_Replicate (sbfrm_Replicate, subform of frm_Survey and page 2 of a tab control) has Replicate_ID primary key, Survey_ID foreign key, and field Replicate_Num
3) tbl_Specimen_Replicate (frm_Specimen_Replicate) has Specimen_ID as primary key and Replicate_ID as a foreign key
So in other words:
tbl_Survey <--- one to many --> tbl_Replicate < --- one to many ---> tbl_Specimen_Replicate
On frm_Specimen_Replicate I would like to have a textbox that shows a concatenation of the Survey_Num and Replicate_Num and I'm not quite sure how to do that. I tried to make the control source of the textbox a sql query but that didn't pan out well. I also tried to use VBA code on the form current event but it didn't like that either. Probably because my code sucks:
Expand|Select|Wrap|Line Numbers
- DoCmd.RunSQL "SELECT tbl_Survey.Survey_Num, tbl_Replicate.Replicate_Num FROM (tbl_Survey INNER JOIN tbl_Replicate ON tbl_Survey.Survey_ID = tbl_Replicate.Survey_ID) INNER JOIN tbl_Specimen_Replicate ON tbl_Replicate.Replicate_ID = tbl_Specimen_Replicate.Replicate_ID;"
Any ideas how I can pull this off?
Thanks!