I am either having an extended blond moment or have been looking at this too long. This is a basic question but I simply cannot get my head around the solution.
I have a Search form with grouped radio buttons. Depending on the selection a different query will run. The problem I am incurring is when I am querying more than one table.
As an example:
SELECT tbl_Claim.Txt_I nsuredName, tbl_Claim.Date_ DOL, tbl_Claim.Mem_P olNo, tbl_Diary.Num_C laimNo, tbl_Diary.Date_ FUpDate, tbl_Diary.Txt_D escription, tbl_Diary.Num_D ocNo, tbl_Diary.Date_ Final, tbl_Diary.Txt_R ecieved
FROM tbl_Diary INNER JOIN tbl_Claim ON tbl_Diary.Num_C laimNo = tbl_Claim.Num_C laimNo
WHERE (((tbl_Claim.Da te_DOL) Between [Enter the Start Date] And [Enter the Finish Date]) AND ((tbl_Claim.Num _ClaimNo)=[tbl_Diary]![Num_ClaimNo]));
I have set the parameter on tbl_Diary!Date_ DOLas this is the only place this piece of information lives, yet the query needs to link back to tbl_Claim to return information that does not exist in tbl_Diary.
When I run from the query window I receive two prompts - one to enter the start date and one to enter the end date (exactly as it should). The problem is when I try & run this in code.
Exactly I have a search form with a group of radio buttons, in this instance if the user selection search by "DOL" then an OpenForm command occurs with the filtering set to this query.
When running from the search form however, I get an additional parameter. It specifically states tbl_Claim!Date_ DOL and is then followed by the parameters I have actually set.
What I need to know is how do I prevent this tbl_Claim!Date_ DOL parameter?
Cheers in advance
VJ
I have a Search form with grouped radio buttons. Depending on the selection a different query will run. The problem I am incurring is when I am querying more than one table.
As an example:
SELECT tbl_Claim.Txt_I nsuredName, tbl_Claim.Date_ DOL, tbl_Claim.Mem_P olNo, tbl_Diary.Num_C laimNo, tbl_Diary.Date_ FUpDate, tbl_Diary.Txt_D escription, tbl_Diary.Num_D ocNo, tbl_Diary.Date_ Final, tbl_Diary.Txt_R ecieved
FROM tbl_Diary INNER JOIN tbl_Claim ON tbl_Diary.Num_C laimNo = tbl_Claim.Num_C laimNo
WHERE (((tbl_Claim.Da te_DOL) Between [Enter the Start Date] And [Enter the Finish Date]) AND ((tbl_Claim.Num _ClaimNo)=[tbl_Diary]![Num_ClaimNo]));
I have set the parameter on tbl_Diary!Date_ DOLas this is the only place this piece of information lives, yet the query needs to link back to tbl_Claim to return information that does not exist in tbl_Diary.
When I run from the query window I receive two prompts - one to enter the start date and one to enter the end date (exactly as it should). The problem is when I try & run this in code.
Exactly I have a search form with a group of radio buttons, in this instance if the user selection search by "DOL" then an OpenForm command occurs with the filtering set to this query.
When running from the search form however, I get an additional parameter. It specifically states tbl_Claim!Date_ DOL and is then followed by the parameters I have actually set.
What I need to know is how do I prevent this tbl_Claim!Date_ DOL parameter?
Cheers in advance
VJ
Comment