By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,863 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,863 IT Pros & Developers. It's quick & easy.

Query by Form to search

P: 15
Hi,
I was working on this form to search based on criterias. I added a combobox with the value lists of <,>,=. Now, I also have a text box control to enter date.
How would I bind the value lists to the text box control?
Like If I want to retrieve all records for anything >1/2/2008....
How would I achieve this? Any help will be appreciated.
Thanks,
PKJ
Jan 14 '08 #1
Share this Question
Share on Google+
3 Replies


MindBender77
100+
P: 234
Hi,
I was working on this form to search based on criterias.
PKJ
First, write a query that contains the dates and the records associated with thoses dates. The criteria for date must come from the form itself.

Next, run the query after the date and <,>, = have be select. Ideally, you want the results to show in a subform if more than one record will be displayed.

You may also want to use a combo box for the dates as well. For example: Search for records between the date in combobox1 and combobox2.
Jan 15 '08 #2

P: 15
Hi,
If you could provide me an example of this, it would he helpful.
I did try something like this, but no luck.

IIf([Forms]![Search Form]![cboperator] Is Null Or [Forms]![Search Form]![txtdate] Is Null,Null & [Forms]![Search Form]![cboperator] & [Forms]![Search Form]![txtdate])

Thanks,
Prasanna.
Jan 15 '08 #3

MindBender77
100+
P: 234
Hi,
If you could provide me an example of this, it would he helpful.
.
The simplest way is to make a select query allowing the first column to be Date. The other columns can be any other information you need.

In the criteria under the Date column enter something like this:

Expand|Select|Wrap|Line Numbers
  1. Criteria: [Forms]![YourFormName]![ComboBox] & [Forms]![YourFormName]![YourDateTextBox]
  2.  
Hope this Helps,
JS
Jan 15 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.