Hi,
I really hope someone can help me because I've already spend 2 days on
this problem and I'm not getting anywhere. I think the problem is that
I don't really understand how text boxes store 'empty' values. I'm
trying tot do the following.
I have a continous sub form that lists transactions. On the top level
form I have some text boxes to let the user specify the transactions
between which dates should be listed. To do this I have two text boxes
with a date format: one for the from date (ctlFrom) and ane for the to
date (ctlTo). Whenever one of the two boxes are updated I requery the
subform. When the boxes are empty I want the query to return all
transactions. The query I use for the subform is:
SELECT account, date, amount, specification FROM tblTransactions
WHERE
((date > Forms!MainForm! ctlFrom) OR (Forms!MainForm !ctlFrom=""))
AND
((date > Forms!MainForm! ctlTo) OR (Forms!MainForm !ctlTo=""));
This works when the text boxes (ctlFrom and ctlTo) contain date values
but not when the text boxes are empty. I've also tried to use NULL
instead of the empty string but the results are the same. Does anyone
know what value I should use to test for an empty box, or perhaps
there are better approaches to what I'm doing.
Thanks, Gertjan 7 8641
Gertjan van Heijst wrote: Hi,
I really hope someone can help me because I've already spend 2 days on this problem and I'm not getting anywhere. I think the problem is that I don't really understand how text boxes store 'empty' values. I'm trying tot do the following.
I have a continous sub form that lists transactions. On the top level form I have some text boxes to let the user specify the transactions between which dates should be listed. To do this I have two text boxes with a date format: one for the from date (ctlFrom) and ane for the to date (ctlTo). Whenever one of the two boxes are updated I requery the subform. When the boxes are empty I want the query to return all transactions. The query I use for the subform is:
SELECT account, date, amount, specification FROM tblTransactions WHERE ((date > Forms!MainForm! ctlFrom) OR (Forms!MainForm !ctlFrom="")) AND ((date > Forms!MainForm! ctlTo) OR (Forms!MainForm !ctlTo=""));
This works when the text boxes (ctlFrom and ctlTo) contain date values but not when the text boxes are empty. I've also tried to use NULL instead of the empty string but the results are the same. Does anyone know what value I should use to test for an empty box, or perhaps there are better approaches to what I'm doing.
Thanks, Gertjan
Just before you requery you could test for the values of the textboxes. I
presume this is in the after_update event.
e.g
If isnull(me.ctlFr om.value) Then
'use different query that selects all records
Else
'use query you specified above
End if
hth
Martin
shouldn't it be date <= Forms!MainForm! ctlTo?
"Gertjan van Heijst" <gv******@xs4al l.nl> wrote in message
news:55******** *************** **@posting.goog le.com... Hi,
I really hope someone can help me because I've already spend 2 days on this problem and I'm not getting anywhere. I think the problem is that I don't really understand how text boxes store 'empty' values. I'm trying tot do the following.
I have a continous sub form that lists transactions. On the top level form I have some text boxes to let the user specify the transactions between which dates should be listed. To do this I have two text boxes with a date format: one for the from date (ctlFrom) and ane for the to date (ctlTo). Whenever one of the two boxes are updated I requery the subform. When the boxes are empty I want the query to return all transactions. The query I use for the subform is:
SELECT account, date, amount, specification FROM tblTransactions WHERE ((date > Forms!MainForm! ctlFrom) OR (Forms!MainForm !ctlFrom="")) AND ((date > Forms!MainForm! ctlTo) OR (Forms!MainForm !ctlTo=""));
This works when the text boxes (ctlFrom and ctlTo) contain date values but not when the text boxes are empty. I've also tried to use NULL instead of the empty string but the results are the same. Does anyone know what value I should use to test for an empty box, or perhaps there are better approaches to what I'm doing.
Thanks, Gertjan
Test ctlFrom and ctlTo prior to constructing your query, if they are null,
assign them values that will include all the data in your table, IE:
ctlFrom = #1/1/1900#
ctlTo = Now()
"Gertjan van Heijst" <gv******@xs4al l.nl> wrote in message
news:55******** *************** **@posting.goog le.com... Hi,
I really hope someone can help me because I've already spend 2 days on this problem and I'm not getting anywhere. I think the problem is that I don't really understand how text boxes store 'empty' values. I'm trying tot do the following.
I have a continous sub form that lists transactions. On the top level form I have some text boxes to let the user specify the transactions between which dates should be listed. To do this I have two text boxes with a date format: one for the from date (ctlFrom) and ane for the to date (ctlTo). Whenever one of the two boxes are updated I requery the subform. When the boxes are empty I want the query to return all transactions. The query I use for the subform is:
SELECT account, date, amount, specification FROM tblTransactions WHERE ((date > Forms!MainForm! ctlFrom) OR (Forms!MainForm !ctlFrom="")) AND ((date > Forms!MainForm! ctlTo) OR (Forms!MainForm !ctlTo=""));
This works when the text boxes (ctlFrom and ctlTo) contain date values but not when the text boxes are empty. I've also tried to use NULL instead of the empty string but the results are the same. Does anyone know what value I should use to test for an empty box, or perhaps there are better approaches to what I'm doing.
Thanks, Gertjan
"Gertjan van Heijst" <gv******@xs4al l.nl> wrote in message
news:55******** *************** **@posting.goog le.com...
<snip> SELECT account, date, amount, specification FROM tblTransactions WHERE ((date > Forms!MainForm! ctlFrom) OR (Forms!MainForm !ctlFrom="")) AND ((date > Forms!MainForm! ctlTo) OR (Forms!MainForm !ctlTo=""));
This will work:
between iif(isnull(Form s!MainForm!ctlF rom),[date],Forms!MainForm !ctlFrom)
AND
iif(isnull(Form s!MainForm!ctlT o),[date],Forms!MainForm !ctlTo)
Also, I'd advise against a field named date, since there is a function with
the same name. It could cause confusion or errors at some point. Use
dateVal or somesuch thing instead.
HTH
Yon-Paul Thanks, Gertjan
Or possibly
If Len(Trim$(myTex tBox.Value & "")) = 0 Then
to also catch those cases where the textbox contains one or more spaces, and
nothing else.
--
Doug Steele, Microsoft Access MVP http://I.Am/DougSteele
"Chuck Grimsby" <c.*******@worl dnet.att.net.in valid> wrote in message
news:g9******** *************** *********@4ax.c om... The *BEST* way to look for either empty or null textbox values (regardless if it's a date, number or text) is to use the syntax:
if len(myTextBox.V alue & "") = 0 then
The & "" part above supplies a length of 0 to a Null (or empty) value, but does nothing if it has anything in it.
You can also use this when you're going through recordsets.
On 30 Aug 2003 05:16:59 -0700, gv******@xs4all .nl (Gertjan van Heijst) wrote:I really hope someone can help me because I've already spend 2 days on this problem and I'm not getting anywhere. I think the problem is that I don't really understand how text boxes store 'empty' values. I'm trying tot do the following.
-- You Have Two Choices For Dinner: Take It Or Leave It.
"Douglas J. Steele" <dj******@canad a.com> wrote in message
news:xK******** ************@ne ws01.bloor.is.n et.cable.rogers .com... Or possibly
If Len(Trim$(myTex tBox.Value & "")) = 0 Then
to also catch those cases where the textbox contains one or more spaces,
and nothing else.
Is it possible to enter one or more spaces, and nothing else, into a textbox
via the keyboard?
"rkc" <rk*@yabba.dabb a.do.rochester. rr.com> wrote in
news:nu******** ***********@twi ster.nyroc.rr.c om: Is it possible to enter one or more spaces, and nothing else, into a textbox via the keyboard?
It's not possible here in Canada (for me, anyway), but I've always assumed it
was there in the USA to faciliate entry of "Reasons for the Invasion of
Iraq", or "Location of Iraq's WMD Caches"?
--
Lyle This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: News Groups |
last post by:
Hello Asp Programmers,
I have a question. I have a form on an ASP page that has 5 text boxes, for
data
entry. I am trying to get data from the text box, and pass it to a hidden
text box on the form.
The hidden text box is called "MyDateTime" (a SQL date and time value).
I am attempting to concatenate data from two other textboxes (one for date
|
by: RC |
last post by:
I have a form with five text boxes on it. The format for all the boxes
is set as General Number. In four of the boxes the user can enter a
number, the fifth box totals up the values in the other boxes. The
data control source for the total box is:
=+++
This works as long as each box has either a number or a zero. If one
of the boxes is empty I get nothing in the total box. I would prefer
not to have a default zero in the boxes because...
|
by: gi75research |
last post by:
What should be a very simple function is going terribly wrong, and I
don't know why. StartTime and EndTime are table values (formatted like
"01:00A" or "02:00P"); DaypartStart and DaypartEnd are string values I
specify when calling the function (initially tried passing time values
& the same problem occurs); In the If statement, I can compare the
exact same time values, and the varCurrentMinute >= varDaypartStart
equality will not work;...
|
by: EDOnLine |
last post by:
New asp.net/webform user question......
I am trying to use the Custom Validator control to check to see if either of
two fields on my form have been filled in. At this point all I am
interested in is if the user has entered a value into EITHER input box (not
left blank). Below is my control code and also my function. I guess my
question is, What should I be testing for in my function? I have tried many
things (checked the length of...
|
by: Xero |
last post by:
Hello. I am using Visual Studio .NET (Academic Edition) to write a VB
program. My computer is running Win XP Pro.
I am writing a calculator and requires users to enter two numbers. After
entering the numbers, they should click a button called 'Display Results'.
How can I display a dialog box prompting the users to check their entry if
they left any of the boxes empty? I have tried the .IsNaN function but in
vein.
Thanks.
| |
by: Josh |
last post by:
We have a program written in VB6 (over 100,000 lines of code and 230 UI
screens) that we want to get out of VB and into a better language. The
program is over 10 years old and has already been ported from VB3 to
VB6, a job which took over two years. We would like to port it to
Python, but we need to continue to offer upgrades and fixes to the
current VB6 version. Does anybody know of ways we could go about
rewriting this, one screen at a...
|
by: Netkiller |
last post by:
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Project: Network News Transport Protocol Server Program
Description:
基于数据库的新闻组,实现BBS前端使用NNTP协议来访问贴子
Reference:
NNTP协议: http://www.mibsoftware.com/userkt/0099.htm
正则表达式:
http://wiki.woodpecker.org.cn/moin/RegExpInPython#head-2358765384844ed72f01658cbcde24613d941e9d
|
by: Petyr David |
last post by:
Just looking for the simplest. right now my perl script returns an
error messge to the user if the date string is invalid. would like to
do this before accessing the server.
TX
|
by: keri |
last post by:
Hi,
I have a table with 2 fields - flddate and category.
The values of flddate are all working day dates (monday to friday
dates between jan 2007 and 2010 (although the end date could change).
I would like to write code to insert the numbers 1 to 6 in repetition
into the category field until every row is filled.
|
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets 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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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: 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: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |