So the goal of my code is to allow a user the option of querying their results using a start and end date (neither are required, but both have to be present for the query to run)
My code for the criteria looks like this: - Between IIf(IsDate([Forms]![Query Transaction Form]![StartDate]),[Forms]![Query Transaction Form]![StartDate],"*") And IIf(IsDate([Forms]![Query Transaction Form]![EndDate]),[Forms]![Query Transaction Form]![EndDate],"*")
Access keeps telling me its incorrect or too long, what can I do?
5 1084
Based on your form name, I'm going to guess that you have a form with a button to run a query based on the values in the textboxes for your date range. If this is the case, then you are better off doing your validation as a test before running your query. I have never tried it, but I don't think that your query will work using the Between * And * which is what would happen if your data wasn't valid. You may need to change the SQL of your query depending on if there is a date provided or not.
How would I validate beforehand if I am allowing users to not enter a date and run the query based on all date ranges?
jforbes 1,107
Recognized Expert Top Contributor
Thank you for all the help! It worked.
NeoPa 32,566
Recognized Expert Moderator MVP
A similar approach might be : - Between Nz([Forms]![Query Transaction Form]![StartDate],#1/1/1900#) And Nz([Forms]![Query Transaction Form]![EndDate],#12/31/9999#)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: D Witherspoon |
last post by:
What is the accepted method of creating a data class or business rules
object class with properties that will allow the returning of null values?
For example... I have a class named CResults with the following properties.
TestID int
QuestionID int
AnswerID int
So, this is a simple example, but I want to be able to know if AnswerID is
|
by: Modest Marsupial |
last post by:
What is the DAO method of allowing a recordset to have null values?
Thanks,
marie
|
by: promiscuoustx |
last post by:
Hi again all!! I am trying to write my program below to validate user input. In other words, if the user inputs something like "1a2.34", I need to return a message that states invalid data and for them to retry. I am really lost on this one, and I really need some help. Thanks so much!!
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cctype>
#include <string>
#include <sstream>
using namespace std;
|
by: Rico |
last post by:
Hello,
I have a foreign key constraint between two tables (Appointments and
MissedAppointmentReasons) and I'd like to allow null values in Appointments
table for the field containing the MissedAppointmentReason, but currently, I
get a Foreign Key Constraint Error when I try to add a record to the
Appointments table.
Any ideas how I can have the null values but still maintain the Foreign Key
Constraint?
|
by: parshupooja |
last post by:
Hi,
I am working in Asp.Net 2.0, SQL Server, C#.
I am trying to create a User Input form which has lots of fields such as :
salutation;
Firstname:
lastname:
address:
Zip:
Phone:
| |
by: Amit |
last post by:
Dear Friends
I need to write a Java Script for a string payment_code which comes
populated from a text field , should contain only 0-9,A-Z,a-z,Space '
',Hyphen '-',Full stop '.',Comma ',',Plus '+'
Characters other than these will not be allowed
If a user enters characters other than the mentioned above , the alert
message should be displayed
|
by: mzovko20 |
last post by:
Hello !
I´m having problem with this. I already created index.html document which allows user to input his/her date of birth. It looks like this :
<html>
<body>
<center>
<h3>How old are you ??</h3>
<table border="0" width="25%">
<form action="calculate.php" method="get">
<td bgcolor="#FFCC00 ">Your name</td>
<td><input type="text" name="name" maxlength="20" value="name"></td>
|
by: ennoil |
last post by:
I am requesting user input from a menu a script. The input I am requesting needs to be an integer. Is it possible to validate that the user actually entered an integer and not a string or just hit enter? Everything I have tried will give me
"File "<string>", line 0, in ?
NameError: name 'd' is not defined
The code I have looks like this:
def init_menu():
print '''
0) Exit
1) Environment
2) Use
|
by: michelle eccles |
last post by:
I have an array with limit of 5 values. The code as writen allows the user to enter a 6th number before averaging the first five number. I want to stop the user from being able to enter that 6th number. thanks for any help. Code below:
using System;
public class SumNumbersArray
{
public static void Main()
{
int arrayA=new int;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |