creating a search form

foxtet

Registered User.
Local time
Tomorrow, 02:09
Joined
May 21, 2011
Messages
129
Hi All helpul friends of Ms Access help center;

i have designed a search form including a text box for user name input, two txt boxes for entering two different dates and list box for display result.
i tried to filter data according to my need but i fond it difficult hence i need your help..

you will find the copy of db attached here..pls help me

fox
 

Attachments

Hi Gina;
thank you for the references those are very helpful.

if its possible can u download the file that i attached and get me a solution for that?

fox
 
Hmmm, okay will have to wait until later (maybe tomorrow) as I am working a few files from Users now. I have looked at you database and am wondering why it is unbound? Is that the way you want it? And why? In order for this to work properly and will less *headache* it would need to be bound to a RecordSource.
 
Hi Gina,
thank you for the reply;

That's true. It can be bound to the record source. you may bring any change in order to get it work..

fox
 
Hey Foxtet / Gina,
I did a little work on it.

I moved the code to the "filter" button.

One thing I noticed is that your date format is different from what the date selectors give. I think that may be the issue on why they don't work, other than that it should work.

you can enter a username click filter and it only shows that user.

When you get the date format worked out then you should be able to pick a date range "OR" user and get results

The "Turn filter off" is "command19" in the code.

hope this helps and gets you pointed in the right direction.

see attached DB

Larry
 

Attachments

I'll just stand over >>>>>> here until we see what happens.
 
Not trying to push you out of the way...just trying to help. :)
 
HEH! not feeling rushed, feeling happy! At least one thing of my plate...
 
Hi Lcook/Gina, :eek:

thank you for your code as it helped me a lot at least to get an idea about filtering data bases on criterion provided.

Data is filtered based on date range regardless of user name, and also there is no msg displayed for blank dates as well as blank user name..
if you can correct the following then it's ok

User must input (1) user name, (2) start date and (3) end Date
there should be necessary error messages if any of these is left blank.
data can only be filtered base on the conditions set by the above 3 text boxes

thank you a lot
fox :):confused::confused::confused:
 
Last edited:
The code I gave you works on my search form. I think it may have somthing to do with the date format you have in the DB. I believe you have DD/MM/YYYY and when you select a date it's format is MM/DD/YYYY
 
Thank you for reply
there is no problem with date. problem is that it doesn't filter for the specific user..
when give two dates the result is shown for all users...

fox
 
I tried Date Ranges and eventually sorted it out the VBA way then I thought that this is just easier all these types of reports are orientated so on the various queries on the Sale Date I put:

Between [Forms]![Sales Dialogue Reports]![Start] And [Forms]![Sales Dialogue Reports]![End]

I didn't need to worry if the Application was used in the States with their differring Date Format as opposed to the intrinsic Database Date format.

Simon
 
It has to be an issue with the date format.

I added the Date/time "EnteredOn" to the query and changed the search code to look for that and it ran fine.

The EnteredOn date/time is formatted as MM/DD/YYYY
Then MeDate date/time is formatted as DD/MM/YYYY

See attached database.
 

Attachments

Thanks lcook,
I really appreciate your work. still its not working for the user specific filter. i mean that it filters values for given two dates for all users. i need to filter for the user typed in the txtUser......

fox
 
Try this one...

you should be able to pick user OR put in a date or both...

I still think you need to take a look at the date format though...the date on the "EnteredOn" is a different format than that of MeDate.
 

Attachments

Users who are viewing this thread

Back
Top Bottom