query of a query

Why not try:

Code:
SELECT [tblAnimal Setup].AnimalSetupID, [tblAnimal Setup].AnimalID,  [tblAnimal Setup].AnimalType, [tblAnimal Setup].Group, [tblAnimal  Setup].location FROM [tblAnimal Setup], WHERE ((([tblAnimal  Setup].AnimalType) = cboanimaltype & "*")) and ((([tblAnimal Setup].Group)=  cbogroup & "*")) and ((([tblAnimal Setup].Location)=cbolocation & "*")) ORDER BY  (animalID)

This way your search does not need to all the combiboxes to be populated and you can search on any of the fields depending on the users request.

Simon
 
Tried the formula below, however it keeps giving me an: syntax error in FROM Clause

SELECT [tblanimal Setup].animalsetupID, [tblanimal setup].animalID, [tblanimal setup].animaltype, [tblanimal setup].group, [tblanimal setup].location FROM
[tblanimal setup], WHERE ((([tblanimal setup].animaltype) = cboanimaltype & "*" )) and ((([Tblanimal setup].group) = cbogroup & "*" )) and ((([tblanimal Setup].location) = cbolocation & "*" )) ORDER BY (animalID);

cannot see an error here?????

Blade
 
Tried the formula below, however it keeps giving me an: syntax error in FROM Clause

SELECT [tblanimal Setup].animalsetupID, [tblanimal setup].animalID, [tblanimal setup].animaltype, [tblanimal setup].group, [tblanimal setup].location FROM
[tblanimal setup], WHERE ((([tblanimal setup].animaltype) = cboanimaltype & "*" )) and ((([Tblanimal setup].group) = cbogroup & "*" )) and ((([tblanimal Setup].location) = cbolocation & "*" )) ORDER BY (animalID);

cannot see an error here?????

Blade

Remove the comma.
 
Thanks Steve,.

It works but it did not work? Gave no errors but it also gave no results no matter what I selected in the first three combos. Keep in mind that the present row source works perfectly except I ow want to add a new parameter that will require in my opinion an if then statement in the row source. Can this be done?

Thanks again for stretching my horizon

Blade
 
It seems that access will not allow an 'if then' statement in the row source of a control mainly because it does not recognize the recordsource on the form. 'If cboGroup = "*ALL*" SELECT [tblanimal setup]......................

Could the validation rule in the property list be used here? I am just asking?

Blade
 
Guess I will answer my own question about the validation rule here. NO
 

Users who are viewing this thread

Back
Top Bottom