Displaying Results

Mahendra

Registered User.
Local time
Today, 07:55
Joined
Sep 19, 2013
Messages
62
Hello,

I have created a 6 search boxes with names Author, Published, Language, Title, Keywords and University. If I enter "A" in Author search field then it should return all the 6 fields which contains "A" in Author field. It worked well. Am happy with it.

My Requirement :

The column published is the year. In search box of Published if I search for 2000 then it's returning all the 6 fields which contains "2000" in Published field.

But most of the people doesn't know the exact year in which the book is published so they need some favour like, If they search for 2000-2010 in Published field then it should return all the fields which are between 2000-2010 in the published field.

For this do I need to create 2 extra text boxes and name them as Starting year and Ending Year? or else we can achieve this in single text box as xxxx-xxxx?

Is it possible in Ms Accéss?

Kindly help me out how to achieve this.

Thanks.​
 
It could be simple to do with two text boxes. If you want to use only one Text box then you need a bit of coding. IMHO, I would go for two text boxes. Easier in implementation, and lesser coding.
 
I added 2 text boxes Start date and End date in the design view and I am unable to link up those two boxes to the Published column.

The main table doesn't contains start date and end date then how can we write a query for those?

Could you kindly help me out on this please.

I had attchached my data sheet for your quick view.

Main:Table is the main table for my database

MForm is the main form.
 

Attachments

Change your published criteria from..
Code:
Like "*" & [Forms]![MForm]![Published] & "*"
to..
Code:
Between Nz([Forms]![MForm]![start],1700) And Nz([Forms]![MForm]![end],3000)
See that I have used Nz function to capture if it is left empty, thus avoiding the use of Like operator. The values I have used are something that would encapsulate all odds. And delete the published text box control from the Form..

Hope this helps.
 
Learned new things from your end today. It worked well and this is what I needed in my output.

Thanks a ton. You helped me in many situations :)
 
You are most welcome, glad to be of help. Good Luck. :)
 
You are most welcome, glad to be of help. Good Luck. :)

I had further 2 more queries which I will be posting it today/tomorrow based on my work. Please don't hesitate for posting queries as am new to MS Access and I have no !dea on this before.

Hoping you to reply in those threads too :)

Have a Great Day!!
 

Users who are viewing this thread

Back
Top Bottom