Hello,
I have a form in Access where I can select some products. When I click a button, a new form is opened and I can see all my products of a brand. As you can see in this screen capture:
Then, when the button "See" is clicked, a new form is opened and the table inside it is set up. It's called "Findproduct". In this form there are two text boxes called Filter and Filter2. They catch the values of KIND and PROVIDER that you can see I the screen capture. Also, the table of this new form is set up, in it's properties Data values, by the following SQL:
With all this my aim is to show in that table information about only two kinds of products: The TypeA ones OR the rest of them.
Well. The problem is that I can not find the way to give filter2 an empty value so that the SQL shows all the results but type A. I've tested with an '*' but it crashes. And no idea of how to tell the program to show all products but the TypeA ones.
There are only these two possibilities: Show the TypeA products or all the others. Only if Type A are selected, this value is loaded in the filter2 textbox at the "FindProduct" form. Else, this textbox remains empty or loaded with an '*'
But still, it fails.
I would appreciate any help or clue to solve this intriguing problem.
I have a form in Access where I can select some products. When I click a button, a new form is opened and I can see all my products of a brand. As you can see in this screen capture:
Then, when the button "See" is clicked, a new form is opened and the table inside it is set up. It's called "Findproduct". In this form there are two text boxes called Filter and Filter2. They catch the values of KIND and PROVIDER that you can see I the screen capture. Also, the table of this new form is set up, in it's properties Data values, by the following SQL:
Code:
SELECT AL.codigo, AL.Nombre, AL.familia, AL.tipo, AL.Iva
FROM AL
WHERE (((AL.familia)=[forms]![findproduct]![filter2]) AND ((AL.tipo)="lentes") AND ((AL.Activo)=True) AND (([codigo] & " " & [nombre]) Like "*" & [forms]![findproduct]![filter] & "*"))
ORDER BY AL.Nombre;
With all this my aim is to show in that table information about only two kinds of products: The TypeA ones OR the rest of them.
Well. The problem is that I can not find the way to give filter2 an empty value so that the SQL shows all the results but type A. I've tested with an '*' but it crashes. And no idea of how to tell the program to show all products but the TypeA ones.
There are only these two possibilities: Show the TypeA products or all the others. Only if Type A are selected, this value is loaded in the filter2 textbox at the "FindProduct" form. Else, this textbox remains empty or loaded with an '*'
But still, it fails.
I would appreciate any help or clue to solve this intriguing problem.
Last edited: