MS Access searching on Age

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Erm

Thread Starter
Joined
Jul 30, 2003
Messages
298
I have a contacts database and I have an Age field in a form which is based on a query. The Age is calculated in the query qryContactDetials and presented in the form TESTSearchfrmContactDetails. The form opens up in the Filter By Form mode to be used as a search form.

The issue is that I want to be able to search on Age in the form using things like >65, but it isn't working. It lists date in the drop down for Age on the form. Where am I going wrong?

Please help!

Debbie
 

Attachments

Joined
Jun 8, 2001
Messages
2,583
I can't seem to use your form. Age drop down is null or not null and when I select one it blows up/shuts down.
 

Erm

Thread Starter
Joined
Jul 30, 2003
Messages
298
I replaced the database just after posting...does it do it on the one attached now?
 

Erm

Thread Starter
Joined
Jul 30, 2003
Messages
298
I just checked...no idea what happened, but this should be doing what I said and hopefully not crash!
 

Attachments

OBP

Joined
Mar 8, 2005
Messages
19,895
Sorry I can't open your database. I assume it is Access 2010.
I would create a table, query & form to maintain a set of Ages ranges like <30 30-60 >60 etc for your combo.
I would then have 2 more fields (not seen in the combo) for Start and Finish ages so for <30 it would be 0 and 30 or 0 & 29 depending on whether or not 30 is "Inclusive".
30-60 would be 30 and 60.
>60 would be 60 and 200.
I would then use those values to populate 2 fields on your "Age Selection Form" and use those with the query as Criteria for use with
Between forms![formname]![startfieldname] And forms![formname]![finishfieldname]
 

Erm

Thread Starter
Joined
Jul 30, 2003
Messages
298
I need to be able to specify different ages sometimes it might be 20-30, >65, <65 or any other range or greater than/less than. What did I need to do so you could open it again OBP?
 

OBP

Joined
Mar 8, 2005
Messages
19,895
You could try saving in Access 2007 format, but that is not always successful either.
It might be I will have to provide an Access 2003 or 2007 database for you to import that database objects in to.
 

Erm

Thread Starter
Joined
Jul 30, 2003
Messages
298
It won't save as an mdb...not sure which bits are not compatible
 

Erm

Thread Starter
Joined
Jul 30, 2003
Messages
298
Here is a basic version in a format you should be able to open, but now I cannot get it to filter by form...?!
 

Attachments

OBP

Joined
Mar 8, 2005
Messages
19,895
So where on the form do you want the Age search parameters to be and how will you display the results?
 

Erm

Thread Starter
Joined
Jul 30, 2003
Messages
298
I want to be able to filter by form and display results in the form.
 

OBP

Joined
Mar 8, 2005
Messages
19,895
Under those circumstances it would make sense to use a VBA set form filter rather than trying to do this in the query as I thought you wanted to do.
I can create some VBA code to do that, however I will need to add fields and an Option Group to the form.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top