473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Microsoft Access - Parameter Query

I am currently writing a query in Access. I need to set up a parameter query for three fields which are called Status (text field), Authorised (date field) and Legal notices (date field).

I need to set it up so that the user can enter info into each of the fields and run the query from that but I also need to set it up so that if nothing is entered into the parameter boxes that it needs to return all results.

I have set up the first parameter query for the status field which I have entered the text below into the criteria box. This appears to work ok.

Like "*" & [status] & "*"

When I try to use something similar on the other two fields to set up the parameter query the query doesn't return any results.
Jan 20 '10 #1
4 2666
nico5038
3,080 Expert 2GB
Did you try to change the datatype of the date fields into a string ?
Just try the Format() function.

Nic;o)
Jan 22 '10 #2
make your query criteria look like this
Expand|Select|Wrap|Line Numbers
  1. like "*" & IIF(Forms!MyFormName.DateFieldName is null,"",Forms!MyFormName.DateFieldName ) & "*"
Jan 23 '10 #3
thanks for the replies. I will have another shot at it using your suggestions.

Thank you
Jan 23 '10 #4
ADezii
8,834 Expert 8TB
Try:
Expand|Select|Wrap|Line Numbers
  1. SELECT tblTest.Status, tblTest.Autorised, tblTest.[Legal Notices] _
  2. FROM tblTest _
  3. WHERE (tblTest.Status Like "*" & [Enter Status] & "*") OR _
  4. ( tblTest.Autorised Like "*" & [Enter Authorized Date] & "*") OR _
  5. (tblTest.[Legal Notices] Like "*" & [Enter Legal Notice Date] & "*");
Jan 23 '10 #5

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

Similar topics

1
by: Joris Kempen | last post by:
Hi people, I know that the question has come around sometimes: How to open an Access Report using ASP and export it to for example RTF. I'm trying to implement the first method of David...
4
by: dcarson | last post by:
I've read about this error in several other discussions, but still can't seem to pinpoint the problem with my code. Everything seemed to be working fine for some time, but it now tends to bomb out...
2
by: SenseForAll | last post by:
First please note I am a novice at VBA and not even that experienced with DAO/ADO and MS-SQL. Any assistance is appreciated. That said... I have an application written in Access w/ VBA. I need to...
4
by: bhbgroup | last post by:
I have a query on one large table. I only add one condition, i.e. a date (the SQL reads like 'where date > parameterdate'. This query is rather quick if 'parameterdate' is either explicitly...
3
by: Lynn A. | last post by:
Access/Word 2000 I am trying to merge a word document with an access query that has a parameter attached to it. Could someone please suggest how to stop the parameter from appearing when the...
2
by: Dirk Vervecken | last post by:
Hi i've got an application in dotnet that uses queries from an Access database. Now most of the common select statements return the desired data, however, one the queries requires a parameter....
3
by: eagleofjade | last post by:
I am trying to help a friend who is learning VB.net in school. I have done VB programming for a number of years using VB 6. He needs to open a query in an Access database that has parameters so he...
2
by: Dud Bug | last post by:
I have a query in an Access db that prompts the user for info. (e.g. a primary key representing a company) before compiling the relevant table of results. This works fine in Access but I want to use...
2
by: Andy | last post by:
Hi guys I having a problem creating a report in Access 2003 project talking to a SQL database through and ODBC connect. After hours of trying things from Access Help, MSDN and Google I still...
8
by: DanicaDear | last post by:
I have something interesting...looking to see if anyone else has came across this. I have a query with parameter and and the query works beautifully every time. However, when I use the wizard...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.