Avatar billede maria.cand Nybegynder
30. september 2003 - 15:58 Der er 15 kommentarer og
1 løsning

2 filtere i samme formular

Jeg formular hvor jeg har en kode der filere ikke interesseret emner - Er det muligt at lave to af slagsen i samme formular altså en hvor jeg sortere afsluttet væk når ja/nej feltet er arktiveret samtidigt med, at jeg sortere ikke interesseret væk når jeg artivere denne??



Til ikke interesseret har jeg følgende kode:

Me.Filter = "interesseret = False"
If Me.FilterOn = True Then
Me.FilterOn = False
Me.Kommandoknap213.Caption = "Fjern filter"
Else
Me.FilterOn = True
Me.Kommandoknap213.Caption = "Filtrer kunder"
End If
Avatar billede terry Ekspert
30. september 2003 - 16:09 #1
Not quite sure I understand fully what you want to do but in answer to your question "Er det muligt at lave to af slagsen i samme formular" then the answer is yes
Avatar billede maria.cand Nybegynder
30. september 2003 - 16:12 #2
Ok Terry jeg mener om det er mulig, at filtere ud fra to forskellige kriterier - Dvs. jeg skal færre og færre emner på listen!!
Avatar billede terry Ekspert
30. september 2003 - 16:13 #3
I think you need to explain the situation when you want to use the two filters filter and also when you do NOT want to use a filter

If me.YesNo Then 'This is a check box for example

Me.Filter = " your filter..... "
Me.FilterOn = True

Else

Me.Filter = " some other filter..... "
Me.FilterOn = True

Endif
Avatar billede terry Ekspert
30. september 2003 - 16:13 #4
Yes I can send an example
Avatar billede maria.cand Nybegynder
30. september 2003 - 16:16 #5
Perfekt Mlouiseb@business.auc.dk
Avatar billede terry Ekspert
30. september 2003 - 16:17 #6
Here it is
http://home1.stofanet.dk/santhel/Download/Search%20demo%2097.zip

It is an example on how to build a filter from values in a number of fields.
Avatar billede maria.cand Nybegynder
30. september 2003 - 16:35 #7
Hmm Terry lad os sige jeg har ialt 7 kunder i min formular

2 er = ikke interesseret

3 er = afsluttet

Når jeg forsøger at lave to filter i samme formular tager den kun en af gangen..

Jeg skulle gerne ved at trykke på knappen "filter ikke interesseret"

Samt klik på knappen "filter afsluttet"

Kun have to emner tilbage på listen - Det er ikke muligt!!!
Avatar billede terry Ekspert
30. september 2003 - 16:59 #8
marai>I dont know if it is possible in YOUR dB but it should be possible.

In your "kunder" table, do you have two fields (yes/no maybe) one indicating that the kustomer is NOT interested (ikke interesseret), and another for closed (afsluttet)?

If you do then you need TWO check boxes on your form, one one "ikke interesseret" adnd the other for "afsluttet"

If you use buttons then this only selects one of the two options and if I understand you correctly you wnat to be able to select BOTH options at the same time! How can you do that with ONE button?????? Or one of TWO buttons! You can only click on one button at a time!!!!!!
Avatar billede terry Ekspert
30. september 2003 - 17:00 #9
If you do then you need TWO check boxes on your form, one one "ikke interesseret" adnd the other for "afsluttet"
=
If you do then you need TWO check boxes on your form, one for "ikke interesseret" and the other for "afsluttet"
Avatar billede maria.cand Nybegynder
30. september 2003 - 17:07 #10
I have this two Check boxes on my form - And i can see your point with two buttoms - Men men der må være et alternativ!!
Avatar billede terry Ekspert
30. september 2003 - 17:26 #11
maria>Its hard for me to give an alternative when I dont know much about your program.
If you look at the example I sent, it changes the filter when you update one of the filter criteria. The more criteria you enter the fewer results are shown. Is this not what you want? Or am I missing something?
Avatar billede terry Ekspert
30. september 2003 - 17:31 #12
In your example 30/09-2003 16:35:13 you said there were 7 customers.

2 er = ikke interesseret
and
3 er = afsluttet

If you place two checkboxes and ONE button on the form, these are to set the filter. One checkbox you check when you want to filter "ikke interesseret" and the othercheck box when you want to filter "afsluttet" you can check NONE, one, or BOTH checkboxes. Then press the button to make the filter.

Then you use the example I sent to see how I build a filter for one or more fields.
Avatar billede terry Ekspert
30. september 2003 - 17:36 #13
You have also to concider that when you check BOTH check boxes then there will be TWO values you have to compare! Is this to be a AND or an OR

SELECT count(*) from YourTable WHERE [ikke interesseret] = 1 OR [afsluttet] = 1
is NOT the same as
SELECT count(*) from YourTable WHERE [ikke interesseret] = 1 AND [afsluttet] = 1
Avatar billede terry Ekspert
30. september 2003 - 17:37 #14
Now I'm off for a while!
Avatar billede terry Ekspert
01. oktober 2003 - 11:08 #15
Maria, do you still need help with this? If you do then I can take a look this evening after work. eksperten@santhell.dk
Avatar billede terry Ekspert
01. oktober 2003 - 20:13 #16
!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester