Nightowl4933
Tryin' to do it right...
- Local time
- Today, 06:42
- Joined
- Apr 27, 2016
- Messages
- 151
Plog very kindly provided a solution to a problem I had with multiple search criteria, but one of the options is causing me a bit of a headache as it doesn't work - and i've only just noticed it!
Basically, I'm using a series of If... Then... to concatentate a search string in to a workable SQL query, but when Ithis is based on field in a table which is a lookup field, I get prompted to 'Enter Parameter Value' and I'm running around in circles trying to fix it!
I'll try to explain:
tblAllApplications has a lookup field 'PlanningAuthority' from tblPlanningAuthority. The SQL code for this lookup is:
In tblPlanningAuthority the datatype for 'Authority' is Text.
In tblAllApplications the datatype for 'PlanningAuthority' is Long Integer - but I don't know (or remember) why I did this!
I get prompted to 'Enter Parameter Value' when the On_Click Event Procedure includes the 'PlanningAuthority' field.
I added another Command Button to the form and used a cut-down version of the Event Procedure, but the result was the same. :banghead:
I also used a simple query based on tblAllApplications with the same criteria results the Event Procedure would return:
...and I get the correct results.
Would someone be kind enough to give me a steer, please?
Edit: Sorry, I forgot to add this all worked perfectly before the database was split.
Basically, I'm using a series of If... Then... to concatentate a search string in to a workable SQL query, but when Ithis is based on field in a table which is a lookup field, I get prompted to 'Enter Parameter Value' and I'm running around in circles trying to fix it!
I'll try to explain:
tblAllApplications has a lookup field 'PlanningAuthority' from tblPlanningAuthority. The SQL code for this lookup is:
Code:
SELECT tblPlanningAuthority.ID, tblPlanningAuthority.Authority
FROM tblPlanningAuthority
ORDER BY tblPlanningAuthority.[Authority];
In tblAllApplications the datatype for 'PlanningAuthority' is Long Integer - but I don't know (or remember) why I did this!
I get prompted to 'Enter Parameter Value' when the On_Click Event Procedure includes the 'PlanningAuthority' field.
I added another Command Button to the form and used a cut-down version of the Event Procedure, but the result was the same. :banghead:
I also used a simple query based on tblAllApplications with the same criteria results the Event Procedure would return:
Code:
SELECT tblAllApplications.PlanningAuthority
FROM tblAllApplications
WHERE (((tblAllApplications.PlanningAuthority)=11));
Would someone be kind enough to give me a steer, please?
Edit: Sorry, I forgot to add this all worked perfectly before the database was split.
Last edited: