Option Group Problem

othmanyg

Registered User.
Local time
Today, 18:33
Joined
Feb 1, 2000
Messages
43
I have a FORM which is based on Query with Parameter BETWEEN [ENTER START DATE] AND [ENTER END DATE]. Within this form there is an OPTION GROUP that filters records based on Group field.

The problem is that when I enter the form the Query will run with the parameter to enter the start date and end date, the same parameter will run again when I select any check box from the OPTION GROUP, so I have to enter start date and end date twice to get the records I need filtered. How can I solve this problem? Basically what I need is to execute the parameter only once I enter the form. Note that when I remove the parameter from the query option group works fine but then I won't be able to select the dates I need to view their records.

Help is much appreciated
 
try this instead:

Code:
>=[From which date do you want records filtered?] And <=[until when?]

Also I have learned how to base a query on what is entered in a form ( see attachment)
 

Attachments

This works but?

Thanks for the quick reply, the code works but again twice, when i first enter the form and when i select any check box from the Option Group to filter.

How can i make this parameter run after i select from the option group or only when i enter the form.

Thanks,
 
1) Do you have any other fields that have any other criteria?

2) does it still do this when you are directly opening the query from the database window?
 
here is the DB

Thanks again,

I attached the DB to clear the problem out, pls go to the WEEKLYEDITFRM, and from there try to select any radio button from SELECT YOUR UNIT.

1. In fact there is no other field with other criteria.
2. No, it it works fine from the query itself.

I hope this is clear now.
 

Attachments

That's even greater than my idea, thanks so much for the time you spent on correcting my problem.

I really appreciate it.

Good day,
 
Just one little thing

hi,
One more thing i noticed, it does not match the unit's items when i selecte the unit and then input the start and end date.

I hope fixing this is easy.
 
othmanyg said:
hi,
One more thing i noticed, it does not match the unit's items when i selecte the unit and then input the start and end date.

I hope fixing this is easy.
Yeah, I noticed that. I was wondering why you had it like that.
try changing the default view to "Single Form" in the form properties
 
smercer said:
Code:
>=[From which date do you want records filtered?] And <=[until when?]

That is the exact same as Between ... And ...

As you then say, base it off a form. The Parameter method is prone to error as it doesn't differentiate between data types and opens the query even if there are no results.
 
Mile-O-Phile said:
That is the exact same as Between ... And ...

As you then say, base it off a form. The Parameter method is prone to error as it doesn't differentiate between data types and opens the query even if there are no results.
Mile in my attachment you will find that it is Referencing a form
 
smercer said:
Mile in my attachment you will find that it is Referencing a form

I guessed that. I was only commenting on the Between .. And
 
Mile-O-Phile said:
I guessed that. I was only commenting on the Between .. And
He asked a specific question and I anwsered a specific anwser
 
That did not work

Hello,

That did not help, It is not filtering now, i just need to filter by unit, how can I do that.

Help is really needed here.
Thanks
 
I forgot to add a bit of code. anyway I have changed it so it is all filtered by the query, since you have it based on the query anyway.
 

Attachments

Great, it is wonderful now

I don't know how to thank you smercer for your great effort to solve this problem. Now it works exactly the way i wanted.

The code will also help me in the other databases i developed.

I wish i could return this help.
Best Regards
 

Users who are viewing this thread

Back
Top Bottom